Пример #1
0
        static void Main(string[] args)
        {
            SpeechSynthesizer synth = new SpeechSynthesizer();

            synth.Speak("hello! This is a grade book program");

            Gradebook book = new Gradebook();

            book.AddGrade(91);
            book.AddGrade(89.5f);
            book.AddGrade(75);

            Gradestatistics stats = book.ComputeStatistics();

            synth.Speak("The average grade in the grade book was");

            WriteResult("Average", stats.AverageGrade);

            synth.Speak("The Highest overall grade was");

            WriteResult("Highest", stats.HighestGrade);

            synth.Speak("The lowest overall grade was");
            WriteResult("Lowest", stats.LowestGrade);

            synth.Speak("Please press any key to continue, Thank you");
            Console.WriteLine("the rain falls during storms");

            Gradebook book2 = new Gradebook();

            book2.AddGrade(18);
            book2.AddGrade(78);

            Gradestatistics info = book2.ComputeStatistics();
        }
Пример #2
0
        public void ComputesLowestGrade()
        {
            Gradebook book = new Gradebook();
            book.AddGrade(10);
            book.AddGrade(90);

            GradeStatistics result = book.ComputeStatistics();
            Assert.AreEqual(10, result.LowestGrade);
        }
Пример #3
0
        public void Test_Letter_Grades()
        {
            Gradebook book = new Gradebook();
            book.AddGrade(91);
            book.AddGrade(89.5f);
            book.AddGrade(75);

            GradeStatistics stats = book.ComputeStatistics();
            Assert.AreEqual("B", stats.LetterGrade);
        }
Пример #4
0
        public void ComputesAverageGrade()
        {
            Gradebook book = new Gradebook();
            book.AddGrade(91);
            book.AddGrade(89.5f);
            book.AddGrade(75);

            GradeStatistics result = book.ComputeStatistics();
            Assert.AreEqual(85.16, result.AverageGrade, 0.01);
        }
Пример #5
0
        static void Main(string[] args)
        {
            Gradebook book = new Gradebook();
            book.AddGrade(91);
            book.AddGrade(89.1f);

            GradeStats stats = book.GradeStats();
            Console.WriteLine(stats.AvGrade);
            Console.WriteLine(stats.HighGrade);
            Console.WriteLine(stats.LowGrade);
        }
Пример #6
0
        public void CalculateHighestGrade()
        {
            Gradebook book = new Gradebook();

            book.AddGrade(90f);
            book.AddGrade(50f);
            book.AddGrade(100);

            GradeStatistics stats = book.ComputeStatistics();

            Assert.AreEqual(90f, stats.HighestGrade);
        }
Пример #7
0
        static void Main(string[] args)
        {
            Gradebook book = new Gradebook();

            book.AddGrade(65);
            book.AddGrade(12);
            book.AddGrade(44);

            GradeStatistics stats = book.ComputeStatistics();

            Console.WriteLine(stats.AverageGrade);
            Console.WriteLine(stats.HighestGrade);
            Console.WriteLine(stats.LowestGrade);
        }
Пример #8
0
        static void Main(string[] args)
        {
            Gradebook book = new Gradebook();

            book.AddGrade(31);
            book.AddGrade(98.7f);
            book.AddGrade(82.5f);

            GradeStatistics stats = book.ComputeStatistics();

            Console.WriteLine("Average grade: " + stats.AverageGrade);
            Console.WriteLine("Highest grade: " + stats.HighestGrade);
            Console.WriteLine("Lowest grade: " + stats.LowestGrade);
        }
Пример #9
0
        static void Main(string[] args)
        {
            Gradebook book = new Gradebook();

            book.AddGrade(89.5f);
            book.AddGrade(91f);
            book.AddGrade(75f);

            GradeStatistics stats = book.ComputeStatistics();


            Console.WriteLine(stats.highestGrade);
            Console.WriteLine(stats.averageGrade);
            Console.WriteLine(stats.lowestGrade);
        }
Пример #10
0
        static void Main(string[] args)
        {
            Gradebook book = new Gradebook();

            book.AddGrade(91);
            book.AddGrade(89.5f);
            book.AddGrade(75);


            GradeStatistics stats = book.ComputeStatistics();

            Console.WriteLine(stats.AverageGrade);
            Console.WriteLine(stats.LowestGrade);
            Console.WriteLine(stats.HighestGade);
            Console.Read();
        }
Пример #11
0
        static void Main(string[] args)
        {
            Gradebook book = new Gradebook();

            book.NameChanged += new NameChangedDelegate(OnNameChanged);

            book.Name = "Will's Gradebook";
            book.Name = null;
            book.AddGrade(91);
            book.AddGrade(89.5f);
            book.AddGrade(75);

            GradeStatistics stats = book.ComputeStatistics();

            Console.WriteLine(book.Name);
            WriteResult("Average", stats.AverageGrade);
            WriteResult("Highest", (int)stats.HighestGrade);
            WriteResult("Lowest", stats.LowestGrade);
        }
Пример #12
0
        static void Main(string[] args)
        {
            // Example of non-standard assembly included in a console program
            SpeechSynthesizer synth = new SpeechSynthesizer();

            synth.Speak("Hello! This is a grade book program!");

            Gradebook book = new Gradebook();

            book.AddGrade(91);
            book.AddGrade(89.5f);
            book.AddGrade(75);

            GradeStatistics stats = book.ComputeStatistics();

            Console.WriteLine("Your average grade: " + stats.AverageGrade);
            Console.WriteLine("Your highest grade: " + stats.HighestGrade);
            Console.WriteLine("Your lowest grade: " + stats.LowestGrade);
        }
Пример #13
0
 private static void AddGrades(Gradebook book)
 {
     book.AddGrade(91f);
     book.AddGrade(89.5f);
     book.AddGrade(75f);
 }