Ejemplo n.º 1
0
        static void Main()
        {
            Student pesho = new Student("Pesho", 8);
            Student gosho = new Student("Gosho", 8, "kaval");
            Teacher stamatov = new Teacher("Stamatov", "bastun");
            Teacher petrova = new Teacher("Petrova");

            Class myClass = new Class("A");
            myClass.AddStudent(pesho);
            myClass.AddStudent(gosho);
            myClass.AddTeacher(stamatov);
            myClass.AddTeacher(petrova);

            Discipline biologia = new Discipline("biologia", 30, 30);
            Discipline matematika = new Discipline("matematika", 40, 40, "cool");

            stamatov.AddDiscipline(biologia);
            petrova.AddDiscipline(matematika);

            for (int i = 0; i < myClass.Students.Count; i++)
            {
                Console.WriteLine(myClass.Students[i].Name);
            }

            Console.WriteLine();
            myClass.RemoveStudent(pesho);

            for (int i = 0; i < myClass.Students.Count; i++)
            {
                Console.WriteLine(myClass.Students[i].Name);
            }

            Console.WriteLine();

            for (int i = 0; i < myClass.Teachers.Count; i++)
            {
                Console.WriteLine(myClass.Teachers[i].Name);
            }

            myClass.RemoveTeacher(petrova);
            Console.WriteLine();

            for (int i = 0; i < myClass.Teachers.Count; i++)
            {
                Console.WriteLine(myClass.Teachers[i].Name);
            }

            stamatov.AddDiscipline(matematika);
            Console.WriteLine();

            for (int i = 0; i < stamatov.Disciplines.Count; i++)
            {
                Console.WriteLine(stamatov.Disciplines[i].NameOfDiscipline);
            }
        }