package CourseRegistrationStarter; import java.util.ArrayList; public class RegistrationSystem { private ArrayList courses; public RegistrationSystem() { courses = new ArrayList<>(); } public void addCourseToSystem(Course c) { courses.add(c); } public Course findCourseByCode(String code) { for (Course a : courses) { if (a.getCourseCode().equals(code)) { return a; } } return null; } public Course findCourseByName(String name) { for (Course a : courses) { if (a.getCourseName().equals(name)) { return a; } } return null; } public void showAllCourses() { for (Course c : courses) { System.out.println(c.getCourseName() + " - " + c.getCourseCode() + " - capacity: " + c.getCapacity()); } } }