Browse Source

Merge branch 'fdai7780'

remotes/origin/fdai7780
Tobias Herbert 11 months ago
parent
commit
0086231bb4
  1. 59
      src/main/java/org/example/Administration.java

59
src/main/java/org/example/Administration.java

@ -1,2 +1,59 @@
package org.example;public class Administration {
package org.example;
import java.util.ArrayList;
import java.util.List;
public class Administration {
private List<Professor> professors;
private List<Admin> admins;
public Administration()
{
this.professors = new ArrayList<>();
this.admins = new ArrayList<>();
}
public boolean deleteProfessor(String professorID)
{
for(Professor professor : professors)
{
if(professor.getProfessorID().equals(professorID)){
professors.remove(professor);
return true; //Course found and removed
}
}
return false;
}
public void addProfessor(Professor professor)
{
professors.add(professor);
}
public boolean deleteAdmin(String AdminID)
{
for(Admin admin : admins )
{
if(admin.getId().equals(AdminID)){
admins.remove(admin);
return true; //Course found and removed
}
}
return false;
}
public void addAdmin(Admin admin)
{
admins.add(admin);
}
} }
Loading…
Cancel
Save