23 lines
644 B
Python
23 lines
644 B
Python
from menu import Menu
|
|
from coffee_maker import CoffeeMaker
|
|
from money_machine import MoneyMachine
|
|
|
|
my_coffee_maker = CoffeeMaker()
|
|
my_menu = Menu()
|
|
my_money_machine = MoneyMachine()
|
|
|
|
is_on = True
|
|
|
|
while is_on == True:
|
|
choice = input(f"What would you like? ({my_menu.get_items()}):")
|
|
|
|
if choice == "report":
|
|
my_coffee_maker.report()
|
|
my_money_machine.report()
|
|
elif choice == "off":
|
|
is_on = False
|
|
else:
|
|
order = my_menu.find_drink(choice)
|
|
if order and my_coffee_maker.is_resource_sufficient(order) and my_money_machine.make_payment(order.cost):
|
|
my_coffee_maker.make_coffee(order)
|