public void SetScore(Abiturient abiturient, ListPassed passed, ListDidNotPass didNotPass) { if (abiturient.RegistretFacultet != null) { if (abiturient.ChangedExam) { Console.WriteLine("Введите бал за алгебру:"); double algebra = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Введите бал за историю:"); double history = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Введите бал за английский язык:"); double english = Convert.ToInt32(Console.ReadLine()); abiturient.AddMidleScore((algebra + history + english) / 3); if (abiturient.MidleScore >= 70) { passed.AddToPassed(abiturient); } else { didNotPass.AddToDidNotPass(abiturient); } } else { Console.WriteLine("Этот абитуриент еще не сдал экзамены."); } } else { Console.WriteLine("Абитуриент еще не выбрал факультет!"); } }
static void Main(string[] args) { Teacher teacher = new Teacher(); ListPassed listPassed = new ListPassed(); ListDidNotPass listDidNotPass = new ListDidNotPass(); Abiturient abiturient1 = new Abiturient("Иванов И."); Abiturient abiturient2 = new Abiturient("Сидоров С."); abiturient1.RegistretToFacultet("Матиматики"); abiturient1.ChangeExam(); abiturient2.RegistretToFacultet("Физики"); teacher.SetScore(abiturient1, listPassed, listDidNotPass); teacher.SetScore(abiturient2, listPassed, listDidNotPass); Console.ReadLine(); }