Files
python_bootcamp/016/main.py
Tanguy Deleplanque a2691e1e06 day 16 - OOP inside !
2025-06-24 10:56:01 +02:00

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)