From 71e4b58bbb8bf44ff86cf1f0df4e8e94e826b231 Mon Sep 17 00:00:00 2001 From: fdai7921 Date: Wed, 7 Feb 2024 15:33:09 +0100 Subject: [PATCH] Adding deleteCourse method in Administration class --- src/main/java/org/example/Administration.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/org/example/Administration.java b/src/main/java/org/example/Administration.java index eedd0f4..ad600be 100644 --- a/src/main/java/org/example/Administration.java +++ b/src/main/java/org/example/Administration.java @@ -30,6 +30,16 @@ public class Administration { courses.add(course); } + public boolean deleteCourse(String courseID){ + for(Course course : courses){ + if(course.getCourseCode().equals(courseID)){ + courses.remove(course); + return true; + } + } + return false; + } + /** * * @param professorID the id of the professor you want to be deleted from the system