示例#1
0
        static void Main(string[] args)
        {
           Gradebook student1 = new Gradebook();
           Gradebook student2 = new Gradebook();
           Gradebook student3 = new Gradebook();
                
           Console.WriteLine("Enter Student 1's First and Last Name.");
           student1.setFirst(Console.ReadLine());
           student1.setLast(Console.ReadLine());
           Console.WriteLine();

           Console.WriteLine("Enter Student 2's First and Last Name.");
           student2.setFirst(Console.ReadLine());
           student2.setLast(Console.ReadLine());
           Console.WriteLine();
                
            Console.WriteLine("Enter Student 3's First and Last Name.");
            student3.setFirst(Console.ReadLine());
            student3.setLast(Console.ReadLine());
            Console.WriteLine();
            

            Console.WriteLine("Student 1's Grades");
            student1.setGrade1(Convert.ToInt32(Console.ReadLine()));
            student1.setGrade2(Convert.ToInt32(Console.ReadLine()));
            student1.setGrade3(Convert.ToInt32(Console.ReadLine()));
            Console.WriteLine();

            Console.WriteLine("Student 2's Grades");
            student2.setGrade1(Convert.ToInt32(Console.ReadLine()));
            student2.setGrade2(Convert.ToInt32(Console.ReadLine()));
            student2.setGrade3(Convert.ToInt32(Console.ReadLine()));
            Console.WriteLine();

            Console.WriteLine("Student 3's Grades");
            student3.setGrade1(Convert.ToInt32(Console.ReadLine()));
            student3.setGrade2(Convert.ToInt32(Console.ReadLine()));
            student3.setGrade3(Convert.ToInt32(Console.ReadLine()));
            Console.WriteLine();

           student1.calcAverage();
           student2.calcAverage();
           student3.calcAverage();

           student1.calcLetterGrade();
           student2.calcLetterGrade();
           student3.calcLetterGrade();

           Console.WriteLine(student1.getFirst() + " " + student1.getLast() + "'s average is: " + student1.getAverage());
           Console.WriteLine(student2.getFirst() + " " + student2.getLast() + "'s average is: " + student2.getAverage());
           Console.WriteLine(student3.getFirst() + " " + student3.getLast() + "'s average is: " + student3.getAverage());
           Console.WriteLine();

           Console.WriteLine((student1.getFirst() + " " + student1.getLast() + "'s letter grade is: " + student1.getLetterGrade()));
           Console.WriteLine((student2.getFirst() + " " + student2.getLast() + "'s letter grade is: " + student2.getLetterGrade()));
           Console.WriteLine((student3.getFirst() + " " + student3.getLast() + "'s letter grade is: " + student3.getLetterGrade()));


           Console.ReadKey();
        }
示例#2
0
        static void Main(string[] args)
        {
            Gradebook student1 = new Gradebook();
            Gradebook student2 = new Gradebook();
            Gradebook student3 = new Gradebook();

            Console.WriteLine("Enter Student 1's First and Last Name.");
            student1.setFirst(Console.ReadLine());
            student1.setLast(Console.ReadLine());
            Console.WriteLine();

            Console.WriteLine("Enter Student 2's First and Last Name.");
            student2.setFirst(Console.ReadLine());
            student2.setLast(Console.ReadLine());
            Console.WriteLine();

            Console.WriteLine("Enter Student 3's First and Last Name.");
            student3.setFirst(Console.ReadLine());
            student3.setLast(Console.ReadLine());
            Console.WriteLine();


            Console.WriteLine("Student 1's Grades");
            student1.setGrade1(Convert.ToInt32(Console.ReadLine()));
            student1.setGrade2(Convert.ToInt32(Console.ReadLine()));
            student1.setGrade3(Convert.ToInt32(Console.ReadLine()));
            Console.WriteLine();

            Console.WriteLine("Student 2's Grades");
            student2.setGrade1(Convert.ToInt32(Console.ReadLine()));
            student2.setGrade2(Convert.ToInt32(Console.ReadLine()));
            student2.setGrade3(Convert.ToInt32(Console.ReadLine()));
            Console.WriteLine();

            Console.WriteLine("Student 3's Grades");
            student3.setGrade1(Convert.ToInt32(Console.ReadLine()));
            student3.setGrade2(Convert.ToInt32(Console.ReadLine()));
            student3.setGrade3(Convert.ToInt32(Console.ReadLine()));
            Console.WriteLine();

            student1.calcAverage();
            student2.calcAverage();
            student3.calcAverage();

            student1.calcLetterGrade();
            student2.calcLetterGrade();
            student3.calcLetterGrade();

            Console.WriteLine(student1.getFirst() + " " + student1.getLast() + "'s average is: " + student1.getAverage());
            Console.WriteLine(student2.getFirst() + " " + student2.getLast() + "'s average is: " + student2.getAverage());
            Console.WriteLine(student3.getFirst() + " " + student3.getLast() + "'s average is: " + student3.getAverage());
            Console.WriteLine();

            Console.WriteLine((student1.getFirst() + " " + student1.getLast() + "'s letter grade is: " + student1.getLetterGrade()));
            Console.WriteLine((student2.getFirst() + " " + student2.getLast() + "'s letter grade is: " + student2.getLetterGrade()));
            Console.WriteLine((student3.getFirst() + " " + student3.getLast() + "'s letter grade is: " + student3.getLetterGrade()));


            Console.ReadKey();
        }