Skip to content
Snippets Groups Projects
Commit c04ca565 authored by kevjov's avatar kevjov
Browse files

Added fuctionalities

parent cc1c1145
No related branches found
No related tags found
No related merge requests found
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=C\:/Program Files/Java/jdk-13.0.2
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
......@@ -6,11 +6,13 @@ package io.fp.campus;
public class App {
public static void main(String[] args) {
Faculty inf = new Faculty("INF");
Professor schmolli = new Professor("Schmollinger", 77, "BPM", inf);
System.out.println(schmolli.getName());
System.out.println("Hält er Vorlesung? "+schmolli.isTalking());
schmolli.setTalking(true);
schmolli.setTalking(false);
System.out.println("Hält er Vorlesung? "+schmolli.isTalking());
Assistent kevin = new Assistent("Jovanovic", 26, inf);
......@@ -34,5 +36,10 @@ public class App {
System.out.println(inf.getAssisOfProf(schmolli));
System.out.println(inf.getProfWithAssis());
System.out.println("Anzahl Profs: " + inf.getAmountProfs());
System.out.println("Anzahl Assis: " + inf.getAmountAssis());
}
}
......@@ -40,7 +40,10 @@ public class Faculty {
ArrayList<Assistent> profassis = new ArrayList<>();
if (!profs.contains(professor)) return profassis;
if (!profs.contains(professor)){
return profassis;
}
for (Assistent assi : assis) {
Professor p = assi.getBoss();
......@@ -51,4 +54,30 @@ public class Faculty {
return profassis;
}
public ArrayList<Professor> getProfWithAssis(){
ArrayList<Professor> profsWithAssis = new ArrayList<>();
for(Assistent assi : assis){
Professor p = assi.getBoss();
if(p != null && !profsWithAssis.contains(p)){
profsWithAssis.add(p);
}
}
return profsWithAssis;
}
public int getAmountProfs(){
return profs.size();
}
public int getAmountAssis(){
return assis.size();
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ public class Professor {
private String name;
private int age;
private boolean isTalking=false;
private boolean isTalking= true;
private String researchArea=null;
private Faculty faculty;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment