Last active
November 30, 2018 13:08
-
-
Save hannojg/c5f04e6a6b7e4e1980e4917b96f9d1eb to your computer and use it in GitHub Desktop.
Vergütung im Krankenhaus, Muster Uni Lübeck 2018/19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Klasse zur Modellierung eines Erwachsenen | |
*/ | |
public class Erwachsener extends Patient { | |
public Erwachsener(String name, int krankheitsklasse) { | |
super(name,krankheitsklasse); | |
} | |
public double getVerguetung() { | |
return super.getVerguetung(); | |
} | |
public void zeigePatient() { | |
System.out.println(getName() + " (Erwachsener)"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Klasse zur Modellierung eines Kindes | |
*/ | |
public class Kind extends Patient { | |
private int alter = 0; //sensible default value | |
public Kind(String name, int krankheitsklasse, int alter) { | |
super(name,krankheitsklasse); | |
this.alter = alter; | |
} | |
@Override | |
public double getVerguetung() { | |
return super.getVerguetung() * 1.25; | |
} | |
public void zeigePatient() { | |
System.out.println(getName() + " (Kind, "+alter+" Jahre)"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Klasse zur Modellierung eines Patienten | |
*/ | |
public abstract class Patient { | |
private String name; | |
private int krankheitsklasse; | |
public Patient(String name, int krankheitsklasse) { | |
this.name = name; | |
this.krankheitsklasse = krankheitsklasse; | |
} | |
public String getName() { | |
return name; | |
} | |
public double getVerguetung() { | |
return (krankheitsklasse==1)? 150 : (krankheitsklasse==2)? 500 : 1000; | |
} | |
public abstract void zeigePatient(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment