Beispiel #1
0
 private static void AddingGrades(Trowawaygb book)
 {
     book.AddGrade(91);
     book.AddGrade(89.5f);
     book.AddGrade(75);
     book.AddGrade(99);
 }
Beispiel #2
0
        private static void GradeStatistics(Trowawaygb book)
        {
            GradeStatistics stats = book.ComputeStatistics();

            Console.WriteLine(book.Name);
            WriteResult("Average", stats.AverageGrade);
            WriteResult("Highest", stats.HighestGrade);
            WriteResult("Lowest", stats.LowestGrade);
        }
Beispiel #3
0
 private static void ShowingGrades(Trowawaygb book)
 {
     using (StreamWriter outputfile = File.CreateText("grades.txt"))
     {
         book.WriteGrades(outputfile);
         //outputfile.Close();
     }
     book.WriteGrades(Console.Out);
 }
Beispiel #4
0
        static void Main(string[] args)
        {
            SpeechSynthesizer synth = new SpeechSynthesizer();

            synth.Speak("Hello! This is the Grade book program by HuBa 95 ");
            Trowawaygb book = new Trowawaygb();

            book.NameChanged = new NameChangedDelegate(OnNameChanged);
            NameBook(book);
            AddingGrades(book);
            ShowingGrades(book);
            GradeStatistics(book);
            Console.ReadKey();
        }