Example #1
0
        static void Main(string[] args)
        {
            var book = new Diskbook("Nagaraj's Book module checks");

            book.GradeAdded += OnGradeAdded;//calling the delegate
            EnterGrades(book);
            var stats = book.GetStatistics();

            Console.WriteLine($"The module is {book.Name}");
            Console.WriteLine($"The lowest grade is {stats.Low}");
            Console.WriteLine($"The highest grade is {stats.High}");
            Console.WriteLine($"The average grade is {stats.Average:N1}");
            Console.WriteLine($"The letter grade is {stats.Letter}");
        }
Example #2
0
        static void Main(string[] args)
        {
            IBook book = new Diskbook("Dallas GradeBook Practice");

            book.GradeAdded += OnGradeAdded;

            EnterGrades(book);

            var stats = book.GetStatistics();

            Console.WriteLine($"For the book named {book.Name}");
            Console.WriteLine($"The lowest grade is {stats.Low}");
            Console.WriteLine($"The highest grade is {stats.High}");
            Console.WriteLine($"The average grade is {stats.Average:N1}");
            Console.WriteLine($"The letter grade is {stats.Letter}");
        }