Files
WS-02-intro-to-oop-Matin/src/CourseRegistrationStarter/Main.java
T
2026-04-22 08:24:36 +03:30

40 lines
1.2 KiB
Java

package CourseRegistrationStarter;
public class Main {
public static void main(String[] args) {
// TODO:
// 1. Create at least 3 courses
Course course1 = new Course("Advanced Programming" , "AP1404", 2) ;
Course course2 = new Course("Data Structures", "DS2201", 1) ;
Course course3 = new Course("Database Systems", "DB3301", 3) ;
// 2. Create 1 student
Student student1 = new Student ("Ali", "402222001") ;
// 3. Create a registration system
RegistrationSystem registrationSystem = new RegistrationSystem() ;
// 4. Add courses to the system
registrationSystem.addCourseToSystem(course1) ;
registrationSystem.addCourseToSystem(course2) ;
registrationSystem.addCourseToSystem(course3) ;
// 5. Register the student in some courses
student1.addCourse(course1) ;
student1.addCourse(course2) ;
student1.addCourse(course3) ;
// 6. Drop one course
student1.dropCourse(course2) ;
// 7. Print the final registered course list
student1.showRegisteredCourses() ;
registrationSystem.showAllCourses();
}
}