コード例 #1
0
        static void Main()
        {
            //instantiate class
            SchoolClass schoolClass = new SchoolClass("1234");
            //add students
            schoolClass.AddStudent(new Student("Mariana Dimitrova", "20"));
            schoolClass.AddStudent(new Student("Ivan Ivanov", "21"));
            schoolClass.AddStudent(new Student("Maria Ivanova", "22"));
            schoolClass.AddStudent(new Student("Dimitur Dimitrov", "23"));
            Console.WriteLine("--------------------------------");
            //add teachers
            Teacher one = new Teacher("Ms Ivanova");
            one.AddDiscipline(new Discipline("Biology", 30, 30));
            Teacher two = new Teacher("Ms Dimitrova");
            two.AddDiscipline(new Discipline("Geography", 30, 30));
            two.AddDiscipline(new Discipline("History", 30, 20));
            schoolClass.AddTeacher(one);
            schoolClass.AddTeacher(two);
            schoolClass.AddTeacher(one);
            Console.WriteLine("--------------------------");

            Console.WriteLine("------------------------");
            schoolClass.PrintStudents();
            Console.WriteLine("-----------------");
            schoolClass.PrintTeachers();
            Console.WriteLine("------------------");
            schoolClass.AddComment("comment");
            schoolClass.AddComment("second comment");
            Console.WriteLine("Comments of the class:");
            schoolClass.ViewComments();
        }
コード例 #2
0
        static void Main()
        {
            //instantiate class
            SchoolClass schoolClass = new SchoolClass("1234");

            //add students
            schoolClass.AddStudent(new Student("Mariana Dimitrova", "20"));
            schoolClass.AddStudent(new Student("Ivan Ivanov", "21"));
            schoolClass.AddStudent(new Student("Maria Ivanova", "22"));
            schoolClass.AddStudent(new Student("Dimitur Dimitrov", "23"));
            Console.WriteLine("--------------------------------");
            //add teachers
            Teacher one = new Teacher("Ms Ivanova");

            one.AddDiscipline(new Discipline("Biology", 30, 30));
            Teacher two = new Teacher("Ms Dimitrova");

            two.AddDiscipline(new Discipline("Geography", 30, 30));
            two.AddDiscipline(new Discipline("History", 30, 20));
            schoolClass.AddTeacher(one);
            schoolClass.AddTeacher(two);
            schoolClass.AddTeacher(one);
            Console.WriteLine("--------------------------");

            Console.WriteLine("------------------------");
            schoolClass.PrintStudents();
            Console.WriteLine("-----------------");
            schoolClass.PrintTeachers();
            Console.WriteLine("------------------");
            schoolClass.AddComment("comment");
            schoolClass.AddComment("second comment");
            Console.WriteLine("Comments of the class:");
            schoolClass.ViewComments();
        }
コード例 #3
0
        static void Main()
        {
            School      school      = new School();
            SchoolClass schoolClass = new SchoolClass("A");

            school.AddClass(schoolClass);
            Console.WriteLine(schoolClass);

            Teacher teacher = new Teacher("Ivan Ivanov");

            teacher.AddDiscipline(new Discipline("Literature", 4, 4));
            schoolClass.AddTeacher(teacher);

            teacher = new Teacher("Petko Petkov");
            teacher.AddComment("Cool!");
            teacher.AddComment("Nice guy!");
            teacher.AddDiscipline(new Discipline("Music", 20, 10));
            schoolClass.AddTeacher(teacher);
            Console.WriteLine(schoolClass.GetTeachers());
            Student student = new Student("Jon", 7);
        }