public override Statistcs GetStatistics()
        {
            var result = new Statistcs();

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

            return(result);
        }
Beispiel #2
0
        public override Statistcs GetStatistics()
        // we use the class identifier Statistics. So this is a public method named GetStatistics, and its return type,
        // that is the type of object is going to return, is Statitics.
        {
            var result = new Statistcs();

            // var arr = new List<double>(){};

            for (var index = 0; index < grades.Count; index++)
            {
                result.Add(grades[index]);
            }
            return(result);
        }
        public override Statistcs GetStatistics()
        {
            var result = new Statistcs();

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

            return(result);
        }