static void Main(string[] args) { IBook book = new DiskBook("Notas da Sheila"); // var book = new InMemoryBook("Notas da Sheila"); book.GradeAdded += OnGradeAdded; EnterGrades(book); var stats = book.GetStats(); Console.WriteLine($"Para o livro {book.Name}"); Console.WriteLine($"A nota mais alta é {stats.High:N1}"); Console.WriteLine($"A nota mais baixa é {stats.Low:N1}"); Console.WriteLine($"A média final é {stats.Average:N1}"); Console.WriteLine($"A letra da nota é {stats.Letter}"); }
static void Main(string[] args) { IBook book = new DiskBook("Naj's Grade Book"); book.GradeAdded += OnGradeAdded; // book.AddGrade(44.2); // book.AddGrade(99.2); // book.AddGrade(22.3); EnterGrades(book); Statistics stats = book.GetStatistics(); Console.WriteLine($"For the book named {book.Name}"); Console.WriteLine($"The lowest grade is {stats.Low:N2}"); Console.WriteLine($"The highest grade is {stats.High:N2}"); Console.WriteLine($"The average is {stats.Average:N2}"); Console.WriteLine($"The letter grade is {stats.Letter}"); }
static void Main(string[] args) { IBook book = new DiskBook("Maths"); book.GradeAdded += OnGradeAdded; book.GradeAdded -= OnGradeAdded; // Removed the previous method. book.GradeAdded += OnGradeAdded; // There is only one subscription now. //book.AddGrades(args); EnterGrade(book); var stats = book.GetStatistics(); Console.WriteLine($"Average grade for {book.Name} is = {stats.Average:N2}"); Console.WriteLine($"Highest grade in {book.Name} is = {stats.High:N2}"); Console.WriteLine($"Lowest grade in {book.Name} is = {stats.Low:N2}"); Console.WriteLine($"The letter grade in {book.Name} is = {stats.Letter}"); }
static void Main(string[] args) { // var book = new InMemoryBook("Scott's Grade Book"); IBook book = new DiskBook("Tom's book"); book.GradeAdded += OnGradeAdded; EnterGrades(book); var stats = book.GetStatistics(); System.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}"); Console.WriteLine($"Letter is {stats.Letter}"); }
static void Main(string[] args) { IBook book = new DiskBook("Scott's Grade Book"); book.GradeAdded += OnGradeAdded; var done = false; EnterGrade(book, done); var stats = book.GetStatistics(); Console.WriteLine($"For the bokk named: {book.Name}"); Console.WriteLine($"The highgrade is: {stats.High}\nThe lowest Grade is: {stats.Low}"); Console.WriteLine($"The average in the grade is {stats.Average:N1}"); Console.WriteLine($"The letter grade is {stats.Letter}"); }
static void Main(string[] args) { IBook book = new DiskBook("Sebastian's Gradebook"); book.GradeAdded += OnGradeAdded; // prompt user to enter grades and loop until they type 'q' to stop 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}"); }
static void Main(string[] args) { IBook iBookObj = null; Console.WriteLine("In Memory or Disk. \n1.Memory\n2.Disk"); string input = Console.ReadLine(); switch (input) { case "1": iBookObj = new InMemoryBook("my Memory Book"); break; case "2": iBookObj = new DiskBook("Mydisk Book"); break; default: break; } GetStatisticsReport(iBookObj); }
static void Main(string[] args) { var book = new DiskBook("Maegan's Grade Book"); book.GradeAdded += OnGradeAdded; EnterGrades(book); Console.WriteLine("Entered Grades Complete"); var statistics = book.GetStatistics(); Console.WriteLine($"The statistics for the book '{book.Name}' are the following:"); // Console.WriteLine($"In the {InMemoryBook.CATEGORY} category..."); Console.WriteLine($"The highest grade is {statistics.HighestGrade}"); Console.WriteLine($"The lowest grade is {statistics.LowestGrade}"); Console.WriteLine($"The average grade is {statistics.AverageGrade:N1}"); Console.WriteLine($"The average letter grade is {statistics.AverageLetterGrade}"); // misc practice fns var practice = new PracticeProblems(); // practice.run(new[] { "Maegan", "Diana" }); }