From c97d4d79893078413c7b18ef44ea2bc51d62f6b8 Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Tue, 6 Feb 2024 20:03:24 +0100 Subject: [PATCH] Added deleteAdmin Method to Administration Class --- src/main/java/org/example/Administration.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/org/example/Administration.java b/src/main/java/org/example/Administration.java index a2f4326..36c81c2 100644 --- a/src/main/java/org/example/Administration.java +++ b/src/main/java/org/example/Administration.java @@ -31,6 +31,22 @@ public class Administration { professors.add(professor); } + public boolean deleteAdmin(String AdminID) + { + for(Admin admin : admins ) + { + if(admin.getId().equals(AdminID)){ + professors.remove(admin); + return true; //Course found and removed + } + } + + return false; + } + + + +