using System; using System.Collections.Generic; namespace GradeBook { public class Book { private List grades; private string name; public Book(string name) { this.name = name; grades = new List(); } public void AddGrade(double grade) { this.grades.Add(grade); } public void ShowStaticstics() { double result = 0; var highGrade = double.MinValue; var lowGrade = double.MaxValue; foreach (var number in this.grades) { highGrade = Math.Max(number, highGrade); lowGrade = Math.Min(number, lowGrade); result += number; } result /= grades.Count; Console.WriteLine($"The average grade is {result:N1}"); Console.WriteLine($"The highest grade is {highGrade:N1}"); Console.WriteLine($"The lowest grade is {lowGrade:N1}"); } } }