diff --git a/gradebook/src/GradeBook/Program.cs b/gradebook/src/GradeBook/Program.cs index a4a009d..f4b443d 100644 --- a/gradebook/src/GradeBook/Program.cs +++ b/gradebook/src/GradeBook/Program.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace GradeBook { @@ -6,15 +7,17 @@ namespace GradeBook { static void Main(string[] args) { - var numbers = new[] {12.7, 10.3, 1.1}; + List grades = new List() {12.7, 10.3, 6.11, 4.1}; + grades.Add(56.1); double result = 0; - foreach (var number in numbers) + foreach (var number in grades) { result += number; } + result /= grades.Count; - System.Console.WriteLine(result); + System.Console.WriteLine($"The average grade is {result}"); if (args.Length > 0) {