complete the RegistrationSystem file

This commit is contained in:
2026-04-22 23:42:58 +03:30
parent 8ddd529c85
commit e2650ab295
2 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="25" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_21" project-jdk-name="21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>
@@ -9,16 +9,21 @@ public class RegistrationSystem {
} }
public void addCourseToSystem(Course c) { public void addCourseToSystem(Course c) {
// TODO: Add the course to the system courses.add(c);
} }
public Course findCourseByCode(String code) { public Course findCourseByCode(String code) {
// TODO: Search for a course by course code for (Course c : courses) {
// Return the matching course if found, otherwise return null if (c.getCourseCode().equals(code)) {
return c;
}
}
return null; return null;
} }
public void showAllCourses() { public void showAllCourses() {
// TODO: Print all courses in the system for (Course c : courses) {
System.out.println(c);
}
} }
} }