public override StatisticDisplayer computeStatistics() { StatisticDisplayer statisticDisplayer = new StatisticDisplayer(); foreach (var grade in grades) { statisticDisplayer.enrollGrade(grade); } return(statisticDisplayer); }
public override StatisticDisplayer computeStatistics() { StatisticDisplayer statistic = new StatisticDisplayer(); using (StreamReader reader = File.OpenText($"{nameof(Name)}.txt")) { string line; while ((line = reader.ReadLine()) != null) { line = line.Trim(); statistic.enrollGrade(double.Parse(line)); } } return(statistic); }