Пример #1
0
        public override Statistics GetStatistics()
        {
            var result = new Statistics();

            for (var index = 0; index < grades.Count; index += 1)
            {
                result.IngestNewGrade(grades[index]);
            }

            return(result);
        }
Пример #2
0
        public override Statistics GetStatistics()
        {
            var result = new Statistics();

            using (var reader = File.OpenText($"{Name}.txt"))
            {
                var line = reader.ReadLine();
                while (line != null)
                {
                    var number = double.Parse(line);
                    result.IngestNewGrade(number);
                    line = reader.ReadLine();
                }
            }
            return(result);
        }