diff --git a/gradebook/src/GradeBook/Program.cs b/gradebook/src/GradeBook/Program.cs index 9ac665c..935521e 100644 --- a/gradebook/src/GradeBook/Program.cs +++ b/gradebook/src/GradeBook/Program.cs @@ -8,15 +8,34 @@ namespace GradeBook static void Main(string[] args) { - var book = new Book("Scott's Grade Book"); - book.AddGrade(89.1); - book.AddGrade(90.5); - book.AddGrade(87.2); - + // var book = new Book("Scott's Grade Book"); + // book.AddGrade(89.1); + // book.AddGrade(90.5); + // book.AddGrade(87.2); + + var book = new Book("Jason's Grade Book"); + string input; + + bool if_continue = true; + while (if_continue) + { + Console.WriteLine("Give input: "); + input = Console.ReadLine(); + if (input == "Q" || input == "q") + { + Console.WriteLine("Receiving termination signal; Termiate program"); + break; + } else + { + Console.WriteLine($"Received: {input}"); + book.AddGrade(Convert.ToDouble(input)); + } + } + var stats = book.GetStatistics(); Console.WriteLine($"The lowest grade is {stats.lowGrade}"); - Console.WriteLine($"The highest grade is {stats.highGrade}"); + Console.WriteLine($"The highesst grade is {stats.highGrade}"); Console.WriteLine($"The average grade is {stats.Average:N1}"); } }