Improvement
This commit is contained in:
parent
c580ecc6e4
commit
b9843e5485
@ -22,6 +22,7 @@ def admin_mode():
|
|||||||
print("1. Add Product")
|
print("1. Add Product")
|
||||||
print("2. Change Price")
|
print("2. Change Price")
|
||||||
print("3. Delete Product")
|
print("3. Delete Product")
|
||||||
|
print("4. Quit Admin Mode")
|
||||||
# Ask for the user input
|
# Ask for the user input
|
||||||
admin_input=input("Please choose an option: ")
|
admin_input=input("Please choose an option: ")
|
||||||
# Check if the input is a number
|
# Check if the input is a number
|
||||||
@ -151,45 +152,53 @@ def payment(sum_of_price):
|
|||||||
rest_cent=rest_euro*100
|
rest_cent=rest_euro*100
|
||||||
|
|
||||||
# 10 Euro
|
# 10 Euro
|
||||||
rest_euro_10=rest_cent//10000
|
rest_euro_10=rest_cent//1000
|
||||||
rest_cent=rest_cent-rest_euro_10*10000
|
rest_cent=rest_cent-rest_euro_10*10000
|
||||||
|
|
||||||
# 5 Euro
|
# 5 Euro
|
||||||
rest_euro_5=rest_cent//5000
|
rest_euro_5=rest_cent//500
|
||||||
rest_cent=rest_cent-rest_euro_5*5000
|
rest_cent=rest_cent-rest_euro_5*5000
|
||||||
|
|
||||||
# 2 Euro
|
# 2 Euro
|
||||||
rest_euro_2=rest_cent//2000
|
rest_euro_2=rest_cent//200
|
||||||
rest_cent=rest_cent-rest_euro_2*2000
|
rest_cent=rest_cent-rest_euro_2*2000
|
||||||
|
|
||||||
# 1 Euro
|
# 1 Euro
|
||||||
rest_euro_1=rest_cent//1000
|
rest_euro_1=rest_cent//100
|
||||||
rest_cent=rest_cent-rest_euro_1*1000
|
rest_cent=rest_cent-rest_euro_1*1000
|
||||||
|
|
||||||
# 50 Cent
|
# 50 Cent
|
||||||
rest_cent_50=rest_cent//500
|
rest_cent_50=rest_cent//50
|
||||||
rest_cent=rest_cent-rest_cent_50*500
|
rest_cent=rest_cent-rest_cent_50*500
|
||||||
|
|
||||||
# 20 Cent
|
# 20 Cent
|
||||||
rest_cent_20=rest_cent//200
|
rest_cent_20=rest_cent//20
|
||||||
rest_cent=rest_cent-rest_cent_20*200
|
rest_cent=rest_cent-rest_cent_20*200
|
||||||
|
|
||||||
# 10 Cent
|
# 10 Cent
|
||||||
rest_cent_10=rest_cent//100
|
rest_cent_10=rest_cent//10
|
||||||
rest_cent=rest_cent-rest_cent_10*100
|
rest_cent=rest_cent-rest_cent_10*100
|
||||||
|
|
||||||
# 5 Cent
|
# 5 Cent
|
||||||
rest_cent_5=rest_cent//50
|
rest_cent_5=rest_cent//5
|
||||||
rest_cent=rest_cent-rest_cent_5*50
|
rest_cent=rest_cent-rest_cent_5*50
|
||||||
|
|
||||||
print ("10 Euro: %s" % rest_euro_10)
|
if rest_euro_10 >=1:
|
||||||
print ("5 Euro: %s" % rest_euro_5)
|
print ("Sie bekommen %smal 10€" % rest_euro_10)
|
||||||
print ("2 Euro: %s" % rest_euro_2)
|
if rest_euro_5 >=1:
|
||||||
print ("1 Euro: %s" % rest_euro_1)
|
print ("Sie bekommen %smal 5€" % rest_euro_5)
|
||||||
print ("50 Cent: %s" % rest_cent_50)
|
if rest_euro_2 >=1:
|
||||||
print ("20 Cent: %s" % rest_cent_20)
|
print ("Sie bekommen %smal 2€" % rest_euro_2)
|
||||||
print ("10 Cent: %s" % rest_cent_10)
|
if rest_euro_1 >=1:
|
||||||
print ("5 Cent: %s" % rest_cent_5)
|
print ("Sie bekommen %smal 1€" % rest_euro_1)
|
||||||
|
if rest_cent_50 >=1:
|
||||||
|
print ("Sie bekommen %smal 50 Cent: %s" % rest_cent_50)
|
||||||
|
if rest_cent_20 >=1:
|
||||||
|
print ("Sie bekommen %smal 20 Cent: %s" % rest_cent_20)
|
||||||
|
if rest_cent_10 >=1:
|
||||||
|
print ("Sie bekommen %smal 10 Cent: %s" % rest_cent_10)
|
||||||
|
if rest_cent_5 >=1:
|
||||||
|
print ("Sie bekommen %smal 5 Cent: %s" % rest_cent_5)
|
||||||
|
|
||||||
normal_mode()
|
normal_mode()
|
||||||
|
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user