Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from menu import Menu, MenuItem
- from coffee_maker import CoffeeMaker
- from money_machine import MoneyMachine
- # DONE print report
- # DONE Check Resources Suffucient
- # DONE Process Coins
- # DONE Check Transaction Successful
- # DONE Make Coffee
- money_machine = MoneyMachine()
- coffee_maker = CoffeeMaker()
- menu = Menu()
- is_on = True
- while is_on:
- options = menu.get_items()
- choice = input(f"What would you like? ({options})").lower()
- if choice == "off":
- is_on = False
- elif choice == "report":
- coffee_maker.report()
- money_machine.report()
- else:
- drink = menu.find_drink(choice)
- if coffee_maker.is_resource_sufficient(drink):
- if money_machine.make_payment(drink.cost):
- coffee_maker.make_coffee(drink)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement