From d7fc850c4c79b85eb0182c10678127f75d729fe8 Mon Sep 17 00:00:00 2001 From: fdai7887 Date: Tue, 6 Feb 2024 20:45:44 +0100 Subject: [PATCH] Added findStudentById Method to Administration class --- src/main/java/org/example/Administration.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/org/example/Administration.java b/src/main/java/org/example/Administration.java index 0f838dc..4f157ba 100644 --- a/src/main/java/org/example/Administration.java +++ b/src/main/java/org/example/Administration.java @@ -80,6 +80,18 @@ public class Administration { return null; } + public Student findStudentById(String StudentId) + { + for(Student student :students) + { + if(student.getId().equals(StudentId)) + { + return student; + } + } + + return null; + } /** * * @param adminID the id of the admin you want to be deleted from the system