diff --git a/src/Dozent.java b/src/Dozent.java new file mode 100644 index 0000000..6140c6f --- /dev/null +++ b/src/Dozent.java @@ -0,0 +1,20 @@ +public class Dozent extends Person{ + + private String bueronummer; + private String telefonnummer; + + + public Dozent(String name, String id, String bueronummer, String telefonnummer) { + super(name, id); + this.bueronummer = bueronummer; + this.telefonnummer = telefonnummer; + } + + public String gibBuero(){ + return bueronummer; + } + + public String gibTelefonnummer() { + return telefonnummer; + } +} diff --git a/src/Person.java b/src/Person.java new file mode 100644 index 0000000..e73dc06 --- /dev/null +++ b/src/Person.java @@ -0,0 +1,15 @@ +public class Person { + + private String name; + private String id; + + public Person(String name, String id){ + this.name = name; + this.id = id; + } + + public String gibInfo(){ + return name + ", ID: " + id; + } + +} diff --git a/src/Student.java b/src/Student.java new file mode 100644 index 0000000..d0b3c77 --- /dev/null +++ b/src/Student.java @@ -0,0 +1,17 @@ +public class Student extends Person{ + + private int anzahlCredits; + + public Student(String name, String id) { + super(name, id); + anzahlCredits = 0; + } + + public int gibCredits() { + return anzahlCredits; + } + + public void erhoeheCredits(int anzahl) { + anzahlCredits += anzahl; + } +}