static void Main(string[] args)
        {
            Student student1 = new Student("John", "Snow", new DateTime(1990, 10, 22), "*****@*****.**");
            Student student2 = new Student("Jaime", "Lanyster", new DateTime(1950, 03, 12), "*****@*****.**");
            Student student3 = new Student("Walter", "White", new DateTime(1975, 12, 27), "*****@*****.**");

            Course course = new Course("Programming with C#", 15);

            course.addStudent(student1);
            course.addStudent(student2);
            course.addStudent(student3);

            Teacher teacher = new Teacher("Jessie", "Pinkman", new DateTime(1985, 04, 03), "*****@*****.**");

            course.addTeacher(teacher);

            Degree degree = new Degree("Bachelor of Science", 250, null);

            degree.Course = course;

            UProgram uProgram = new UProgram("Information Technology", "Gustavo Fring", null);

            uProgram.Degree = degree;

            Console.WriteLine("The {0} program contains the {1} degree\n", uProgram.ProgramName, degree.DegreeName);
            Console.WriteLine("The {0} degree contains the course {1}\n", degree.DegreeName, course.CourseName);
            Console.WriteLine("The {0} course contains {1} student(s)\n", course.CourseName, course.StudentsNumber);
        }
示例#2
0
        static void Main(string[] args)
        {
            Student student1 = new Student("Deepak", "Kumar", "10/10/1994", "UBC", "Vancouver");
            Student student2 = new Student("Mahdi", "Aziz", "20/03/1990", "UBC", "Vancouver");
            Student student3 = new Student("Megan", "Kruz", "21/03/1994", "UBC", "Vancouver");

            Student[] students = { student1, student2, student3 };
            Teacher[] teachers = new Teacher[3];
            Course    course0  = new Course(students, teachers, "Programming with C#");
            Degree    deg1     = new Degree(new Course[] { course0 }, "Bachelor of Science");
            UProgram  program1 = new UProgram(deg1, "Information Technology");

            Console.WriteLine("The {0} Program contain the {1} degree.", program1.Name, deg1.DegreeName);
            Console.WriteLine("The {0} degree contains the course {1}.", deg1.DegreeName, course0.Name);
            Console.WriteLine("The {0} course contains {1} student(s).", course0.Name, course0.Students.Length);
        }