Пример #1
0
        static void Main(string[] args)
        {
            Student s1 = new Student(), s2 = new Student(), s3 = new Student();
            Teacher t1 = new Teacher();
            Course ProgrammingWithCSharp = new Course("Programming with C#");

            ProgrammingWithCSharp.AddStudent(s1);
            ProgrammingWithCSharp.AddStudent(s2);
            ProgrammingWithCSharp.AddStudent(s3);

            ProgrammingWithCSharp.AddTeacher(t1);

            Degree Bachelor = new Degree("Bachelor");
            Bachelor.AddCourse(ProgrammingWithCSharp);

            UProgram InformationTechnology = new UProgram("Information Technology");
            InformationTechnology.AddDegree(Bachelor);

            Console.WriteLine("The " + InformationTechnology.name + " program contains the " + InformationTechnology.degree.name + " of Sciense degree\n");
            Console.WriteLine("The " + InformationTechnology.degree.name + " of Sciense degree contains the course " + InformationTechnology.degree.course.name + "\n");
            Console.WriteLine("The " + InformationTechnology.degree.course.name + " course contains " + Student.TrackStudent.student_num + " student<s>");
            Console.ReadLine();
        }
Пример #2
0
 public void AddTeacher(Teacher t)
 {
     if (teacher_num >= SIZE)
         throw new IndexOutOfRangeException("Number of teacher can't be more than 3");
     arr_teacher[teacher_num++] = t;
 }