Aufgabe6 bearbeitet
This commit is contained in:
parent
4816f2a8d2
commit
93417f38eb
@ -2,7 +2,13 @@ package Uebungsaufgaben;
|
||||
|
||||
public class Aufgabe6 {
|
||||
public static void main(String[] args){
|
||||
System.out.println("HAllo Welt");
|
||||
Arbeiter meier = new Arbeiter(4711, "Meier", "Frank", 14.67);
|
||||
meier.print();
|
||||
Facharbeiter mueller = new Facharbeiter(4712, "Müller", "Steffi", 18.33, "Chemie");
|
||||
mueller.print();
|
||||
Manager kaiser = new Manager(4713, "Kaiser", "Karl-Heinz", 19.00,
|
||||
10, "Matzda Cabrio", "S-ZZ-999");
|
||||
kaiser.print();
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +31,13 @@ class Angestellter extends Mitarbeiter{
|
||||
|
||||
double monatsGehalt;
|
||||
|
||||
public Angestellter(int personalNummer, String name, String vorname, double monatsGehalt) {
|
||||
this.personalNummer = personalNummer;
|
||||
this.name = name;
|
||||
this.vorname = vorname;
|
||||
this.monatsGehalt = monatsGehalt;
|
||||
}
|
||||
|
||||
void print(){
|
||||
System.out.println(getPersonalNummer());
|
||||
System.out.println(getName());
|
||||
@ -33,11 +46,57 @@ class Angestellter extends Mitarbeiter{
|
||||
}
|
||||
}
|
||||
|
||||
class LeitenderAngestellter extends Angestellter{
|
||||
|
||||
double bonus;
|
||||
|
||||
|
||||
public LeitenderAngestellter(int personalNummer, String name, String vorname, double monatsGehalt, double bonus) {
|
||||
super(personalNummer, name, vorname, monatsGehalt);
|
||||
this.bonus = bonus;
|
||||
}
|
||||
void print(){
|
||||
System.out.println(getPersonalNummer());
|
||||
System.out.println(getName());
|
||||
System.out.println(getVorname());
|
||||
System.out.println(monatsGehalt);
|
||||
System.out.println(bonus);
|
||||
}
|
||||
}
|
||||
|
||||
class Manager extends LeitenderAngestellter{
|
||||
|
||||
String firmenWagenTyp;
|
||||
String kennzeichen;
|
||||
|
||||
|
||||
public Manager(int personalNummer, String name, String vorname, double monatsGehalt, double bonus, String firmenWagenTyp, String kennzeichen) {
|
||||
super(personalNummer, name, vorname, monatsGehalt, bonus);
|
||||
this.firmenWagenTyp = firmenWagenTyp;
|
||||
this.kennzeichen = kennzeichen;
|
||||
}
|
||||
void print(){
|
||||
System.out.println(getPersonalNummer());
|
||||
System.out.println(getName());
|
||||
System.out.println(getVorname());
|
||||
System.out.println(monatsGehalt);
|
||||
System.out.println(bonus);
|
||||
System.out.println(firmenWagen);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Arbeiter extends Mitarbeiter{
|
||||
|
||||
double stundenSatz;
|
||||
|
||||
public Arbeiter(int personalNummer, String name, String vorname, double stundenSatz) {
|
||||
this.personalNummer = personalNummer;
|
||||
this.name = name;
|
||||
this.vorname = vorname;
|
||||
this.stundenSatz = stundenSatz;
|
||||
}
|
||||
|
||||
void print(){
|
||||
System.out.println(getPersonalNummer());
|
||||
System.out.println(getName());
|
||||
@ -51,6 +110,11 @@ final class Facharbeiter extends Arbeiter{
|
||||
|
||||
String fachRichtung;
|
||||
|
||||
public Facharbeiter(int personalNummer, String name, String vorname, double stundenSatz, String fachRichtung) {
|
||||
super(personalNummer, name, vorname, stundenSatz);
|
||||
this.fachRichtung = fachRichtung;
|
||||
}
|
||||
|
||||
void print(){
|
||||
System.out.println(getPersonalNummer());
|
||||
System.out.println(getName());
|
||||
|
Loading…
x
Reference in New Issue
Block a user