workshop done

This commit is contained in:
2026-04-20 21:16:24 +03:30
commit a80a1c47bf
9 changed files with 250 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
import java.util.ArrayList;
public class RegistrationSystem {
private ArrayList<Course> courses;
public RegistrationSystem() {
courses = new ArrayList<>();
}
public void addCourseToSystem(Course c) {
// Add the course to the system
courses.add(c);
}
public Course findCourseByCode(String code) {
// Search for a course by course code
for (Course c : courses) {
if (c.getCourseCode().equals(code)) {
return c;
}
}
return null;
}
public void showAllCourses() {
// Print all courses in the system
for (Course c : courses) {
System.out.println(
c.getCourseName() + " - " +
c.getCourseCode() +
" | Remaining capacity: " +
c.getCapacity()
);
}
}
}