Example #1
0
        public override Statistics GetStatistics()
        {
            var result = new Statistics();

            foreach (var grade in grades)
            {
                result.AddGrade(grade);
            }
            return(result);
        }
Example #2
0
        public override Statistics GetStatistics()
        {
            var stats = new Statistics();

            foreach (var grade in Grades)
            {
                stats.AddGrade(grade);
            }

            return(stats);
        }
Example #3
0
        public override Statistics GetStatistics()
        {
            var result = new Statistics();

            using (var reader = File.OpenText($"{Name}.txt"))
            {
                var line = reader.ReadLine();
                while (line != null)
                {
                    result.AddGrade(double.Parse(line));
                    line = reader.ReadLine();
                }
            }
            return(result);
        }
Example #4
0
        public override Statistics GetStatistics()
        {
            var results = new Statistics();

            using (var reader = File.OpenText($"../../../../{Name}.txt"))
            {
                var line = reader.ReadLine();
                // While it isnt the end of the file
                while (line != null)
                {
                    var number = double.Parse(line);
                    results.AddGrade(number);
                    line = reader.ReadLine();
                }
            }

            return(results);
        }
Example #5
0
        public override Statistics GetStatistics()
        {
            var stats = new Statistics();

            using (var reader = File.OpenText($"{Name}.txt"))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    stats.AddGrade(double.Parse(line));
                }
                // var line = reader.ReadLine();
                // while(line != null)
                // {
                //     stats.AddGrade(double.Parse(line));
                //     line = reader.ReadLine();
                // }
            }

            return(stats);
        }