From 680d7afeee33c963777a708c40606ffbe9de9321 Mon Sep 17 00:00:00 2001 From: Matin-Ardestani Date: Tue, 21 Apr 2026 00:20:54 +0330 Subject: [PATCH] Compelete Main class with an example scenario) --- src/CourseRegistrationStarter/Main.java | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/CourseRegistrationStarter/Main.java b/src/CourseRegistrationStarter/Main.java index 8f06373..06b727b 100644 --- a/src/CourseRegistrationStarter/Main.java +++ b/src/CourseRegistrationStarter/Main.java @@ -4,11 +4,34 @@ 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 SBU = new RegistrationSystem(); + // 4. Add courses to the system + SBU.addCourseToSystem(course1); + SBU.addCourseToSystem(course2); + SBU.addCourseToSystem(course3); + // 5. Register the student in some courses + student1.addCourse(course1); + student1.addCourse(course2); + // 6. Drop one course + student1.dropCourse(course2); + // 7. Print the final registered course list + System.out.printf("%s registered courses:\n", student1.getName()); + student1.showRegisteredCourses(); + + System.out.println("\nRemaining informations of courses are as follows: "); + SBU.showAllCourses(); + } }