From 2712242d1c7e34c0e989e31b7242e664a460b545 Mon Sep 17 00:00:00 2001 From: fdai7887 Date: Tue, 6 Feb 2024 20:34:01 +0100 Subject: [PATCH] Added deleteStudents Method to Administration class --- src/main/java/org/example/Administration.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/example/Administration.java b/src/main/java/org/example/Administration.java index 4e1742d..7e26c08 100644 --- a/src/main/java/org/example/Administration.java +++ b/src/main/java/org/example/Administration.java @@ -52,7 +52,15 @@ public class Administration { admins.add(admin); } - + public boolean deleteStudents(String StudentID){ + for(Student student : students){ + if(student.getId().equals(StudentID)){ + students.remove(student); + return true; + } + } + return false; + }