Exemplo n.º 1
0
 public void Start()
 {
     ReadPoints();
     Console.WriteLine("");
     PrintGradeDistribution();
     Console.WriteLine("The average of points: " + register.AverageOfPoints());
     Console.WriteLine("The average of grades: " + register.AverageOfGrades());
 }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            GradeRegister register = new GradeRegister();

            UserInterface ui = new UserInterface(register);

            ui.Start();
            Console.WriteLine("the average of points: " + register.AverageOfPoints());
            Console.WriteLine("The average of grades: " + register.AverageOfGrades());
        }
Exemplo n.º 3
0
        public void PrintGradeDistribution()
        {
            int grade = 5;

            while (grade >= 0)
            {
                int stars = register.NumberOfGrades(grade);
                Console.Write(grade + ": ");
                PrintStars(stars);
                Console.WriteLine();

                grade = grade - 1;
            }
            Console.WriteLine("The average of grades: " + register.AverageOfPoints());
            Console.WriteLine("The average of points: " + register.AverageOfGrades());
        }
Exemplo n.º 4
0
        public static void Main(string[] args)
        {
            GradeRegister register = new GradeRegister();

            register.AddGradeBasedOnPoints(93);
            register.AddGradeBasedOnPoints(91);
            register.AddGradeBasedOnPoints(92);
            register.AddGradeBasedOnPoints(88);

            Console.WriteLine(register.AverageOfGrades());


            UserInterface ui = new UserInterface(register);

            ui.Start();
        }
Exemplo n.º 5
0
 public void End()
 {
     Console.WriteLine("The average of points: " + register.AverageOfPoints());
     Console.WriteLine("The average of grades: " + register.AverageOfGrades());
 }
Exemplo n.º 6
0
        public void TestAverageOfGradesLarger()
        {
            GradeRegister register = new GradeRegister();

            register.AddGradeBasedOnPoints(151);
            register.AddGradeBasedOnPoints(80);
            register.AddGradeBasedOnPoints(89);
            register.AddGradeBasedOnPoints(99);
            register.AddGradeBasedOnPoints(89);
            register.AddGradeBasedOnPoints(79);
            register.AddGradeBasedOnPoints(61);
            register.AddGradeBasedOnPoints(50);
            register.AddGradeBasedOnPoints(49);
            Assert.AreEqual(Math.Round(Convert.ToDouble("3.11", System.Globalization.CultureInfo.InvariantCulture), 2), register.AverageOfGrades(), "The average should be from all the grades");
        }
Exemplo n.º 7
0
 public static void PrintAverages(GradeRegister register)
 {
     Console.WriteLine(register.AverageOfPoints());
     Console.WriteLine(register.AverageOfGrades());
 }