Esempio n. 1
0
        // Becuase of the use of the virtual keyword in GradeBook.cs
        // The behaviour of this method will depend on the type of GradeBook
        // being passed to this method, that is of course assuming that we
        // have overridden the ComputeStatistics method
        private static void WriteResults(GradeTracker book)
        {
            GradeStatistics stats = book.ComputeStatistics();

            WriteResult("Average", stats.AverageGrade);
            WriteResult("Highest", stats.HighestGrade);
            WriteResult("Lowest", stats.LowestGrade);
            WriteResult(stats.Description, stats.LetterGrade);
        }
Esempio n. 2
0
        private static void WriteResults(GradeTracker book)
        {
            GradeStatistics stats = book.ComputeStatistics();

            Console.WriteLine(book.Name);
            WriteResult("Average", stats.AverageGrade);
            WriteResult("Highest", (int)stats.HighestGrade);
            WriteResult("Lowest", stats.LowestGrade);
            WriteResult(stats.Description, stats.LetterGrade);
            WriteResult("Params", stats.LowestGrade, 5, 6, 7); //Params - can pass an array of variable length
            Console.Read();
        }
Esempio n. 3
0
        /*
         * private static void WriteGradesInBytes(GradeTracker book)
         * {
         *
         *  foreach (float grade in book.grades)
         *  {
         *      WriteasBytes((int)grade);
         *  }
         * }*/

        private static void WriteResults(GradeTracker book)
        {
            GradeStatistics stats = book.ComputeStatistics();

            WriteResult("Average", (int)stats.AverageGrade);
            WriteResult("AverageFloat", stats.AverageGrade);
            WriteResult("AverageLetterGrade", stats.LetterGrade);
            WriteResult("AverageLetterDescription", stats.Description);
            WriteResult(stats.Description, stats.LetterGrade);
            Console.WriteLine(stats.AverageGrade);
            Console.WriteLine(stats.LowestGrade);
            Console.WriteLine(stats.HighestGrade);
        }
Esempio n. 4
0
 private static GradeStatistics Save(GradeTracker Book)
 {
     return(Book.ComputeStatistics());
 }