implement tasks based on README

This commit is contained in:
2026-04-19 23:46:05 +03:30
parent 8ddd529c85
commit c04246c885
3 changed files with 36 additions and 0 deletions
@@ -9,16 +9,25 @@ public class RegistrationSystem {
}
public void addCourseToSystem(Course c) {
this.courses.add(c);
// TODO: Add the course to the system
}
public Course findCourseByCode(String code) {
for (Course c: this.courses) {
if (c.getCourseCode().equals(code)) {
return c;
}
}
// TODO: Search for a course by course code
// Return the matching course if found, otherwise return null
return null;
}
public void showAllCourses() {
for(Course c: this.courses) {
System.out.println(c.getCourseName() + ", code: " + c.getCourseCode());
}
// TODO: Print all courses in the system
}
}