public override Statistics GetStatistics() { var result = new Statistics(); foreach (var grade in grades) { result.AddNum(grade); } return(result); }
public override Statistics GetStatistics() { var result = new Statistics(); using (var bookFile = File.OpenText($"{Name}.txt")) { while (true) { var line = bookFile.ReadLine(); if (line == null) { break; } else { var grade = double.Parse(line); result.AddNum(grade); } } return(result); } }