static void Main(string[] args) { Student s1 = new Student("Angel", "Munoz", new DateTime(1992, 05, 16), "Dir1", "Juarez", "Chihuahua", 12345, "Mexico"); Student s2 = new Student("Perla", "Lopez", new DateTime(1992, 12, 10), "Dir1", "Juarez", "Chihuahua", 12345, "Mexico", "Dir2"); Student s3 = new Student("Victor", "Munoz", new DateTime(1992, 07, 10), "Dir1", "Juarez", "Chihuahua", 12345, "Mexico"); Student[] students = { s1, s2, s3 }; Teacher t1 = new Teacher("Dora", "Rivero", new DateTime(1980, 05, 16), "Dir1", "Juarez", "Chihuahua", 12345, "Mexico"); Teacher t2 = new Teacher("Ricardo", "Trejo", new DateTime(1981, 03, 19), "Dir1", "Juarez", "Chihuahua", 12345, "Mexico", "Dir2"); Teacher t3 = new Teacher("Victor", "Arellanes", new DateTime(1980, 05, 10), "Dir1", "Juarez", "Chihuahua", 12345, "Mexico"); Teacher[] teachers = { t1, t2, t3 }; Course PCS = new Course("Programming with C#", 15, 6, teachers, students); Course PFS = new Course("Programming with F#", 12, 7, teachers, students); Course PJ = new Course("Programming with Java", 15, 5, teachers, students); Course[] courses = { PCS, PFS, PJ }; Degree bachelor = new Degree("Bachelor", 500, courses); UProgram uprogram = new UProgram("Information Technology", "Mike Perez", bachelor); Console.WriteLine("Program: {0}\nDegree: {1}", uprogram.PName, uprogram.Degree.Name); Console.WriteLine("Course:{0}\nStudents in Course: {1}", uprogram.Degree.Courses[0].CName, Student.StudentAmt); foreach(Student student in PCS.Students) { student.TakeTest(); } foreach (Teacher teacher in PCS.Teachers) { teacher.GradeTest(); } Console.ReadKey(); }
static void Main(string[] args) { /* Teacher[] teacher = new Teacher[] { new Teacher("William", "Hanna", "7/14/1910", "3400 Cahuenga Blvd. West", "", "Hollywood", "CA", "90028", "USA"), new Teacher("Joseph", "Barbera", "3/24/1911", "3400 Cahuenga Blvd. West", "", "Hollywood", "CA", "90028", "USA") }; Course course = new Course("Programming with C#", student, teacher); Degree degree = new Degree("Bachelor", course); UProgram program = new UProgram("Information Technology", degree); Console.WriteLine("The {0} program contains the {1} degree\n", program.ProgramTitle, program.Degree.DegreeTitle); Console.WriteLine("The {0} degree contains the course {1}\n", degree.DegreeTitle, degree.Course.CourseTitle); Console.WriteLine("The {0} course contains {1} student(s)", degree.Course.CourseTitle, Student.StudentCount); Console.WriteLine("\nInstructors such as {0} may perform the following...", degree.Course.Teacher[0].FullName); Teacher.GradeTest(); Console.WriteLine("\nStudents such as {0} may perform the following...", degree.Course.Student[0].FullName); Student.TakeTest(); */ Student student1 = new Student("Fred", "Flintstone", "9/30/1960", "301 Cobblestone Way", "", "Bedrock", "LA", "70777", "USA"); Student student2 = new Student("Barney", "Rubble", "9/30/1960", "301 Cobblestone Way", "", "Bedrock", "LA", "70777", "USA"); Student student3 = new Student("Wilma", "Flintstone", "9/30/1960", "301 Cobblestone Way", "", "Bedrock", "LA", "70777", "USA"); student1.Grades.Push(75); student1.Grades.Push(80); student1.Grades.Push(99); student1.Grades.Push(100); student1.Grades.Push(98); student2.Grades.Push(77); student2.Grades.Push(78); student2.Grades.Push(79); student2.Grades.Push(80); student2.Grades.Push(81); student3.Grades.Push(90); student3.Grades.Push(85); student3.Grades.Push(80); student3.Grades.Push(75); student3.Grades.Push(70); Course course = new Course("Programming with C#"); course.Student.Add(student1); course.Student.Add(student2); course.Student.Add(student3); course.ListStudents(); Console.WriteLine("Press any key to continue . . ."); Console.ReadKey(); }
public Degree(Course course) { this.course = course; }
public Degree(string degreeTitle, Course course) { DegreeTitle = degreeTitle; Course = course; }