100 Days of Code: The Complete Python Pro Bootcamp for 2022 - Day 16 (Object Oriented Programming)
I imported the code as provided by the course and all I needed to do was complete this project using OOP instead of Procedural Programming. This was a carry on or next step for the original Coffee Machine Maker for Day 15
frommenuimportMenu,MenuItemfromcoffe_makerimportCoffeeMakerfrommoney_machineimportMoneyMachinemenu=Menu()menu_item=MenuItem('name','water','milk','coffee','cost')coffee_maker=CoffeeMaker()money_machine=MoneyMachine()is_on=Truewhileis_on:options=menu.get_items()choice=input(f"What would you like? ({options}): ")ifchoice=="off":is_on=Falseelifchoice=="report":coffee_maker.report()money_machine.report()else:drink=menu.find_drink(choice)ifcoffee_maker.is_resource_sufficient(drink)andmoney_machine.make_payment(drink.cost):coffee_maker.make_coffee(drink)
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)