127 lines
4.1 KiB
Python
127 lines
4.1 KiB
Python
# Zielorte:
|
|
print("Willkommen bei der DB. \r\nHier können Sie mit Verspätung immer rechnen. \r\nBitte wählen sie ein Zielort aus.")
|
|
print("Zielorte:\n")
|
|
print("1.Erfurt-5,80€ \r\n2.Arnstadt-3,50€ \r\n3.Bahnhof Rennsteig-4,00€ \r\n4.Venedig-380,00€ \r\n5.Singapur-1250,00€ \r\n6.Ilmenau-Pörlitzer-Höhe-3,00€\r\n7.Berlin-300,69€\r\n8. Soeul-2500€")
|
|
ziel = int(input("Bitte wählen sie ein Zielort aus: \r\n"))
|
|
if ziel == 1:
|
|
preis=5.80
|
|
elif ziel == 2:
|
|
preis=3.50
|
|
elif ziel == 3:
|
|
preis=4.00
|
|
elif ziel == 4:
|
|
preis=380.00
|
|
elif ziel == 5:
|
|
preis=1250.00
|
|
elif ziel == 6:
|
|
preis=3.00
|
|
elif ziel == 7:
|
|
preis = 300.69
|
|
elif ziel == 8:
|
|
preis = 2500
|
|
else:
|
|
print("Bitte geben sie einen gültigen Wert ein.")
|
|
exit()
|
|
|
|
# Anzahl Fahrscheine:
|
|
anzahl = int(input("Bitte geben sie die Anzahl der Fahrscheine ein: \r\n"))
|
|
zu_zahlen = anzahl * preis
|
|
|
|
#Rabattierung:
|
|
alter=int(input("Bitte geben sie ihr Alter ein: \r\n"))
|
|
if alter > 65:
|
|
zu_zahlen_gesamt = round(zu_zahlen * 0.5, 2)
|
|
elif alter < 8:
|
|
zu_zahlen_gesamt = round(zu_zahlen * 0.25, 2)
|
|
elif alter > 8 and alter <= 17:
|
|
zu_zahlen_gesamt = round(zu_zahlen * 0.75, 2)
|
|
else:
|
|
zu_zahlen_gesamt = zu_zahlen
|
|
|
|
# Ausgabe:
|
|
print("Sie müssen", zu_zahlen_gesamt, "Euro zahlen.")
|
|
|
|
# Geldüberrückgabe:
|
|
print("Wieviel Geld werfen Sie ein?")
|
|
sie_zahlen=int(input())
|
|
|
|
if sie_zahlen < zu_zahlen_gesamt:
|
|
print("Sie haben nicht genug Geld.")
|
|
exit()
|
|
|
|
rest=round(sie_zahlen-zu_zahlen_gesamt, 2)
|
|
print("Restbetrag:", rest)
|
|
rest_in_Cent=rest*100
|
|
print("Restbetrag in Cent:", rest_in_Cent)
|
|
|
|
# Stückelung
|
|
anzahl_200Euro=rest_in_Cent//20000
|
|
rest_in_Cent=rest_in_Cent%20000
|
|
if anzahl_200Euro>=1:
|
|
#print("2€:", anzahl_2Euro)
|
|
print("Sie bekommen:",anzahl_200Euro, "x 200€ Scheine zurück.")
|
|
anzahl_100Euro=rest_in_Cent//10000
|
|
rest_in_Cent=rest_in_Cent%10000
|
|
if anzahl_100Euro>=1:
|
|
#print("2€:", anzahl_2Euro)
|
|
print("Sie bekommen:",anzahl_100Euro, "x 100€ Scheine zurück.")
|
|
anzahl_50Euro=rest_in_Cent//5000
|
|
rest_in_Cent=rest_in_Cent%5000
|
|
if anzahl_50Euro>=1:
|
|
#print("2€:", anzahl_2Euro)
|
|
print("Sie bekommen:",anzahl_50Euro, "x 50€ Scheine zurück.")
|
|
anzahl_20Euro=rest_in_Cent//2000
|
|
rest_in_Cent=rest_in_Cent%2000
|
|
if anzahl_20Euro>=1:
|
|
#print("2€:", anzahl_2Euro)
|
|
print("Sie bekommen:",anzahl_20Euro, "x 20€ Scheine zurück.")
|
|
anzahl_10Euro=rest_in_Cent//1000
|
|
rest_in_Cent=rest_in_Cent%1000
|
|
if anzahl_10Euro>=1:
|
|
#print("2€:", anzahl_2Euro)
|
|
print("Sie bekommen:",anzahl_10Euro, "x 10€ Scheine zurück.")
|
|
anzahl_5Euro=rest_in_Cent//500
|
|
rest_in_Cent=rest_in_Cent%500
|
|
if anzahl_5Euro>=1:
|
|
#print("2€:", anzahl_2Euro)
|
|
print("Sie bekommen:",anzahl_5Euro, "x 5€ Scheine zurück.")
|
|
anzahl_2Euro=rest_in_Cent//200
|
|
rest_in_Cent=rest_in_Cent%200
|
|
if anzahl_2Euro>=1:
|
|
#print("2€:", anzahl_2Euro)
|
|
print("Sie bekommen:",anzahl_2Euro, "x 2€ Stücken zurück.")
|
|
anzahl_1Euro=rest_in_Cent//100
|
|
rest_in_Cent=rest_in_Cent%100
|
|
if anzahl_1Euro>=1:
|
|
#print("1€:", anzahl_1Euro)
|
|
print("Sie bekommen:",anzahl_1Euro, "x 1€ Stücken zurück.")
|
|
anzahl_50Cent=rest_in_Cent//50
|
|
rest_in_Cent=rest_in_Cent%50
|
|
if anzahl_50Cent>=1:
|
|
#print("50Cent:", anzahl_50Cent)
|
|
print("Sie bekommen:",anzahl_50Cent, "x 50Cent Stücken zurück.")
|
|
anzahl_20Cent=rest_in_Cent//20
|
|
rest_in_Cent=rest_in_Cent%20
|
|
if anzahl_20Cent>=1:
|
|
#print("20Cent:", anzahl_20Cent)
|
|
print("Sie bekommen:",anzahl_20Cent, "x 20Cent Stücken zurück.")
|
|
anzahl_10Cent=rest_in_Cent//10
|
|
rest_in_Cent=rest_in_Cent%10
|
|
if anzahl_10Cent>=1:
|
|
#print("10Cent:", anzahl_10Cent)
|
|
print("Sie bekommen:",anzahl_10Cent, "x 10Cent Stücken zurück.")
|
|
anzahl_5Cent=rest_in_Cent//5
|
|
rest_in_Cent=rest_in_Cent%5
|
|
if anzahl_5Cent>=1:
|
|
#print("5Cent:", anzahl_5Cent)
|
|
print("Sie bekommen:",anzahl_5Cent, "x 5Cent Stücken zurück.")
|
|
anzahl_2Cent=rest_in_Cent//2
|
|
rest_in_Cent=rest_in_Cent%2
|
|
if anzahl_2Cent>=1:
|
|
#print("2Cent:", anzahl_2Cent)
|
|
print("Sie bekommen:",anzahl_2Cent, "x 2Cent Stücken zurück.")
|
|
anzahl_1Cent=rest_in_Cent//1
|
|
rest_in_Cent=rest_in_Cent%1
|
|
if anzahl_1Cent>=1:
|
|
#print("1Cent:", anzahl_1Cent)
|
|
print("Sie bekommen:",anzahl_1Cent, "x 1Cent Stücken zurück.") |