public Auto(string Hersteller, string Modell, double PS, Autotyp Typ = Autotyp.Unbekannt) { nummer = nextNr; nextNr++; hersteller = Hersteller; modell = Modell; if (PS <= 0) { throw new ArgumentOutOfRangeException(); } ps = PS; typ = Typ; }
public static String getStringOfAutotyp(Autotyp typ) { switch (typ) { case Autotyp.Bus: return("Bus"); case Autotyp.Caddy: return("Caddy"); case Autotyp.PKW: return("PKW"); default: return(""); } }