AddTeacher() 공개 메소드

public AddTeacher ( Teacher teacher ) : void
teacher Teacher
리턴 void
        public static void TestSchoolSystem()
        {
            var firstClass = new Class("12B");

            firstClass.AddStudent(new Student("Ivan", 1));
            firstClass.AddStudent(new Student("Todor", 2));
            firstClass.AddStudent(new Student("Dragan", 3));
            firstClass.AddStudent(new Student("Penka", 4));
            firstClass.AddTeacher(new Teacher("Radev"));
            firstClass.AddTeacher(new Teacher("Ivan Ivanov", "Great teacher!"));
            var ivailoTeacher = new Teacher("Ivailo Ivanov");

            ivailoTeacher.AddDiscipline(new Discipline("Math", 2, 2));
            ivailoTeacher.AddDiscipline(new Discipline("Informatics", 5, 9));
            ivailoTeacher.AddDiscipline(new Discipline("Biology", 1, 1));
            firstClass.AddTeacher(ivailoTeacher);

            var secondClass = new Class("12A");

            secondClass.AddStudent(new Student("Pesho", 12));
            secondClass.AddStudent(new Student("Tosho", "Best student", 2));
            secondClass.AddStudent(new Student("Ivancho", "Poot student", 4));
            secondClass.AddTeacher(new Teacher("Petko"));
            secondClass.AddTeacher(new Teacher("Ivan", "Best teacher in uour school"));
            var school = new School("SOU Tsar Simeon Veliki");

            school.AddClass(firstClass);
            school.AddClass(secondClass);

            Console.WriteLine(school);
        }
예제 #2
0
        static void Main()
        {
            var someSchool       = new School();
            var eveningClass     = new Class("Level#2");
            var trainer          = new Teacher("Mr. NakMan");
            var disciplineClassA = new Discipline("OOP", 2, 2);

            var firstStudent  = new Student("Anamalech", 1);
            var thirdStudent  = new Student("Corson", 3);
            var secondStudent = new Student("Boruta", 2);
            var forthStudent  = new Student("Lucifer", 4);

            //Okay. Let's summon the demons... pardon, Demos!
            someSchool.AddClass(eveningClass);
            eveningClass.AddTeacher(trainer);
            trainer.AddDiscipline(disciplineClassA);

            eveningClass.AddStudent(firstStudent);
            eveningClass.AddStudent(secondStudent);
            eveningClass.AddStudent(thirdStudent);
            eveningClass.AddStudent(forthStudent);

            Console.WriteLine(eveningClass.ToString());
            Console.WriteLine();
        }
        static void Main()
        {
            var someSchool = new School();
            var eveningClass = new Class("Level#2");
            var trainer = new Teacher("Mr. NakMan");
            var disciplineClassA = new Discipline("OOP", 2, 2);

            var firstStudent = new Student("Anamalech", 1);
            var thirdStudent = new Student("Corson", 3);
            var secondStudent = new Student("Boruta", 2);
            var forthStudent = new Student("Lucifer", 4);

            //Okay. Let's summon the demons... pardon, Demos!
            someSchool.AddClass(eveningClass);
            eveningClass.AddTeacher(trainer);
            trainer.AddDiscipline(disciplineClassA);

            eveningClass.AddStudent(firstStudent);
            eveningClass.AddStudent(secondStudent);
            eveningClass.AddStudent(thirdStudent);
            eveningClass.AddStudent(forthStudent);

            Console.WriteLine(eveningClass.ToString());
            Console.WriteLine();
        }
        static void Main()
        {
            string star = new string('*', 40);
            var listOfStudents = new List<Student>() {
                new Student ("Bob", "Hoohev","5554578"),
                new Student ("Horhe", "Jokev", "154587"),
                new Student ("Mimeto", "Simetova", "154747"),
                new Student ("Ivanka", "Gerginova", "5558412"),
                new Student ("Hoanito", "Ignatovic", "9845247"),
                new Student ("Alona", "O'Brail", "445588"),
                new Student ("Maria", "Gabana", "857496"),
                new Student ("Francoa", "Galaga", "154578"),
                new Student ("Cristine", "Lubenova", "134579"),
                new Student ("Lubov", "Nadejdova", "555875")
            };
            Console.WriteLine("Print all the students:");
            Console.WriteLine(star);
            foreach (var student in listOfStudents)
            {
                Console.WriteLine(student.ToString());
            }
            Console.WriteLine(star);

            var listOfTeachers = new List<Teacher>();
            listOfTeachers.Add(new Teacher("Ivanka", "Dimitrova"));
            listOfTeachers[0].AddDiscipline("PIK", 2, 1);
            listOfTeachers[0].AddDiscipline("CSharp", 6, 6);
            listOfTeachers.Add(new Teacher("Dori", "Annova"));
            listOfTeachers[1].AddDiscipline("OS", 7, 7);
            listOfTeachers[1].AddDiscipline("OOP", 21, 15);
            listOfTeachers[1].AddDiscipline("Maths", 19, 17);

            Console.WriteLine("Print all the teachers:");
            Console.WriteLine(star);
            foreach (var teacher in listOfTeachers)
            {
                Console.WriteLine(teacher.ToString());
            }
            Console.WriteLine(star);

            var firstClass = new Class("Boombastick");
            foreach (var teacher in listOfTeachers)
            {
                if (teacher.Disciplines.Count < 3)
                {
                    firstClass.AddTeacher(teacher);
                }
            }

            foreach (var student in listOfStudents)
            {
                if (student.ID.Contains("555"))
                {
                    firstClass.AddStudent(student);
                }
            }
            Console.WriteLine("Print the class:");
            Console.WriteLine(firstClass);
        }