added error message if you choose pay without any ticket chosen

This commit is contained in:
Joel
2021-01-01 18:08:26 +01:00
parent cc35c25f65
commit a6c8119473
@@ -57,6 +57,11 @@ class Fahrkartenautomat
} }
public static double fahrkartenBezahlen(double zuZahlenderBetrag) { public static double fahrkartenBezahlen(double zuZahlenderBetrag) {
if (zuZahlenderBetrag == 0) {
System.out.println("Nichts zu Bezahlen");
fahrkartenbestellungErfassen();
}
Scanner tastatur = new Scanner(System.in); Scanner tastatur = new Scanner(System.in);
// Geldeinwurf // Geldeinwurf
// ----------- // -----------