workshop 02
This commit is contained in:
@@ -2,13 +2,34 @@ package CourseRegistrationStarter;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
// TODO:
|
||||
// 1. Create at least 3 courses
|
||||
// 2. Create 1 student
|
||||
// 3. Create a registration system
|
||||
// 4. Add courses to the system
|
||||
// 5. Register the student in some courses
|
||||
// 1. Create courses
|
||||
Course c1 = new Course("Advanced Programming", "AP1404", 2);
|
||||
Course c2 = new Course("Data Structures", "DS2201", 1);
|
||||
Course c3 = new Course("Database Systems", "DB3301", 3);
|
||||
|
||||
// 2. Create student
|
||||
Student student = new Student("Ali", "402222001");
|
||||
|
||||
// 3. Create registration system
|
||||
RegistrationSystem system = new RegistrationSystem();
|
||||
|
||||
// 4. Add courses to system
|
||||
system.addCourseToSystem(c1);
|
||||
system.addCourseToSystem(c2);
|
||||
system.addCourseToSystem(c3);
|
||||
|
||||
// 5. Register student in courses
|
||||
student.addCourse(system.findCourseByCode("AP1404"));
|
||||
student.addCourse(system.findCourseByCode("DS2201"));
|
||||
|
||||
// 6. Drop one course
|
||||
// 7. Print the final registered course list
|
||||
student.dropCourse(system.findCourseByCode("DS2201"));
|
||||
|
||||
// 7. Print final results
|
||||
System.out.println("===== FINAL STUDENT COURSES =====");
|
||||
student.showRegisteredCourses();
|
||||
|
||||
System.out.println("\n===== SYSTEM COURSES =====");
|
||||
system.showAllCourses();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user