From 85e0713fd9a70e37688170e10a7ac4829f470810 Mon Sep 17 00:00:00 2001 From: fdai7921 Date: Wed, 7 Feb 2024 15:35:32 +0100 Subject: [PATCH] Adding findCourseByID method in Administration class --- src/main/java/org/example/Administration.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/example/Administration.java b/src/main/java/org/example/Administration.java index ad600be..2be4f6a 100644 --- a/src/main/java/org/example/Administration.java +++ b/src/main/java/org/example/Administration.java @@ -40,6 +40,15 @@ public class Administration { return false; } + public Course findCourseByID(String courseID){ + for(Course course : courses){ + if(course.getCourseCode().equals(courseID)){ + return course; + } + } + return null; + } + /** * * @param professorID the id of the professor you want to be deleted from the system @@ -86,8 +95,6 @@ public class Administration { } - - /** * * @param adminID the id of the admin you want to be deleted from the system