public static void ShowStatistic(DiaryStatistic stats)
        {
            //SpeechSynthesizer synth = new SpeechSynthesizer();
            //synth.Speak("Who is the most beautiful girl in the world?    Anna");

            WriteResult("Średnia ocena: ", stats.AverageGrade, 5, 6, 8, 4, 5, 6, 3);
            WriteResult("Najmniejsza ocena: ", (int)stats.MinGrade);
            WriteResult("Najwieksza ocena: ", (long)stats.MaxGrade);
            WriteResult("Najwieksza ocena: ", (long)stats.MaxGrade, 1);
        }
示例#2
0
        //Metody

        // Computes statitistic (average, max and min grade) for given student
        internal DiaryStatistic ComputeStatistic()
        {
            DiaryStatistic stats = new DiaryStatistic();
            float          sum   = 0f;

            foreach (var rating in ratings)
            {
                sum += rating;
            }
            stats.AverageGrade = sum / ratings.Count();
            stats.MaxGrade     = ratings.Max();
            stats.MinGrade     = ratings.Min();
            return(stats);
        }