Last active
July 13, 2018 02:18
-
-
Save d630/68dcfc707621e683e390a09c75290246 to your computer and use it in GitHub Desktop.
Tag 11: Flugzeuge
This file contains 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
namespace csharp | |
{ | |
public class Flugzeug | |
{ | |
private string hersteller; | |
private int maxSpeed; | |
private string immatNum; | |
private int anzahlFluegel = 1; | |
private const int LOOPINGSPEED = 320; | |
public Flugzeug(string hersteller, int maxSpeed, int anzahlFluegel) | |
{ | |
this.hersteller = hersteller; | |
this.maxSpeed = maxSpeed; | |
this.anzahlFluegel = anzahlFluegel; | |
} | |
public string ImmatNum { get; set; } | |
public virtual bool getLooping() | |
{ | |
return this.maxSpeed > LOOPINGSPEED; | |
} | |
} | |
public class Verkehrsflugzeug : Flugzeug | |
{ | |
private int anzahlPassagiere; | |
public Verkehrsflugzeug(string hersteller, int maxSpeed, string immatNum, int anzahlPassagiere) : base(hersteller, maxSpeed, 1) | |
{ | |
this.anzahlPassagiere = anzahlPassagiere; | |
base.ImmatNum = immatNum; | |
} | |
public int getAnzahlPassagiere() | |
{ | |
return this.anzahlPassagiere; | |
} | |
public void setAnzahlPassagiere(int anzahlPassagiere) | |
{ | |
this.anzahlPassagiere = anzahlPassagiere; | |
} | |
public override sealed bool getLooping() | |
{ | |
return false; | |
} | |
} | |
public class Doppeldecker : Flugzeug | |
{ | |
private readonly bool offenesCockpit; | |
public Doppeldecker(string hersteller,int maxSpeed,string immatNum, bool offenesCockpit) : base(hersteller, maxSpeed, 2) | |
{ | |
this.offenesCockpit = offenesCockpit; | |
} | |
public Doppeldecker(string hersteller, int maxSpeed, string immatNum) : base(hersteller, maxSpeed, 2) | |
{ | |
this.offenesCockpit = true; | |
} | |
public bool isOffenesCockpit() | |
{ | |
return this.offenesCockpit; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment