Aufgabe 6 Nr. 1
This commit is contained in:
parent
af6542b137
commit
40c41300ac
11
S01-VL06-Aufgabe 1/Angestellter.java
Normal file
11
S01-VL06-Aufgabe 1/Angestellter.java
Normal file
@ -0,0 +1,11 @@
|
||||
class Angestellter extends Mitarbeiter {
|
||||
|
||||
double monatsGehalt;
|
||||
|
||||
void print(){
|
||||
System.out.println(getPersonalNummer());
|
||||
System.out.println(getName());
|
||||
System.out.println(getVorname());
|
||||
System.out.println(monatsGehalt);
|
||||
}
|
||||
}
|
11
S01-VL06-Aufgabe 1/Arbeiter.java
Normal file
11
S01-VL06-Aufgabe 1/Arbeiter.java
Normal file
@ -0,0 +1,11 @@
|
||||
class Arbeiter extends Mitarbeiter{
|
||||
|
||||
double stundenSatz;
|
||||
|
||||
void print(){
|
||||
System.out.println(getPersonalNummer());
|
||||
System.out.println(getName());
|
||||
System.out.println(getVorname());
|
||||
System.out.println(stundenSatz);
|
||||
}
|
||||
}
|
6
S01-VL06-Aufgabe 1/Aufgabe.java
Normal file
6
S01-VL06-Aufgabe 1/Aufgabe.java
Normal file
@ -0,0 +1,6 @@
|
||||
class Aufgabe {
|
||||
public static void main(String[] args) {
|
||||
Manager person = new Manager();
|
||||
person.print();
|
||||
}
|
||||
}
|
12
S01-VL06-Aufgabe 1/Facharbeiter.java
Normal file
12
S01-VL06-Aufgabe 1/Facharbeiter.java
Normal file
@ -0,0 +1,12 @@
|
||||
final class Facharbeiter extends Arbeiter{
|
||||
|
||||
String fachRichtung;
|
||||
|
||||
void print(){
|
||||
System.out.println(getPersonalNummer());
|
||||
System.out.println(getName());
|
||||
System.out.println(getVorname());
|
||||
System.out.println(stundenSatz);
|
||||
System.out.println(fachRichtung);
|
||||
}
|
||||
}
|
12
S01-VL06-Aufgabe 1/LeitenderAngestellter.java
Normal file
12
S01-VL06-Aufgabe 1/LeitenderAngestellter.java
Normal file
@ -0,0 +1,12 @@
|
||||
public class LeitenderAngestellter extends Angestellter {
|
||||
double bonus;
|
||||
|
||||
LeitenderAngestellter(double bonus) {
|
||||
super();
|
||||
}
|
||||
|
||||
void print() {
|
||||
super.print();
|
||||
System.out.println("Bonus: " + bonus);
|
||||
}
|
||||
}
|
21
S01-VL06-Aufgabe 1/Manager.java
Normal file
21
S01-VL06-Aufgabe 1/Manager.java
Normal file
@ -0,0 +1,21 @@
|
||||
class Manager extends LeitenderAngestellter {
|
||||
Dienstwagen dienstwagen;
|
||||
|
||||
void print() {
|
||||
super.print();
|
||||
|
||||
if(dienstwagen != null) {
|
||||
dienstwagen.print();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Dienstwagen {
|
||||
String kennzeichen;
|
||||
String wagentyp;
|
||||
|
||||
void print() {
|
||||
System.out.println("Kennzeichen: " + kennzeichen);
|
||||
System.out.println("Wagentyp: " + wagentyp);
|
||||
}
|
||||
}
|
14
S01-VL06-Aufgabe 1/Mitarbeiter.java
Normal file
14
S01-VL06-Aufgabe 1/Mitarbeiter.java
Normal file
@ -0,0 +1,14 @@
|
||||
abstract class Mitarbeiter{
|
||||
int personalNummer;
|
||||
String name;
|
||||
String vorname;
|
||||
|
||||
abstract void print();
|
||||
void setPersonalNummer(int i){personalNummer=i;}
|
||||
void setName(String s){name=s;}
|
||||
void setVorname(String s){vorname=s;}
|
||||
|
||||
int getPersonalNummer(){return personalNummer;}
|
||||
String getName(){return name;}
|
||||
String getVorname(){return vorname;}
|
||||
}
|
Loading…
Reference in New Issue
Block a user