coffee.py - class Product: def...

This preview shows page 1 out of 1 page.

class Product:def __init__(self,name,price,recipe):self.name = nameself.price = priceself.recipe = recipedef get__price(self):return self.pricedef make(self):print(self.recipe)class Cashbox:def __init__(self):self.credit = 0self.totalreceived = 0def deposit(self,amount):self.credit += amountclass Selector:def __init__(self,cashbox,products):self.cashbox = Cashbox()self.products = productsclass CoffeeMachine:def __init__(self):self.cashbox = Cashbox()products = []products.append(Product("black",35,"add cup,pour coffee"))
End of preview. Want to read the entire page?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
CharlesD.Allison
Tags
Subroutine

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture