From fa3193ee4aa2daa4e6b859f7c9d6629db311b964 Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Tue, 6 Feb 2024 20:11:05 +0100 Subject: [PATCH] Added findProfessorById 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 d7cd3bf..1c00bc8 100644 --- a/src/main/java/org/example/Administration.java +++ b/src/main/java/org/example/Administration.java @@ -49,6 +49,18 @@ public class Administration { admins.add(admin); } + public Professor findProfessorById(String professorId) + { + for(Professor professor :professors) + { + if(professor.getProfessorID().equals(professorId)) + { + return professor; + } + } + + return null; + }