Guest User

Untitled

a guest
May 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. def __init__(self):
  2. self.cust = Customer() # Создаем и встраиваем customer and employee
  3. self.empl = Employee()
  4.  
  5. def order(self, foodName): # начинаем имитацию заказа блюда
  6. self.cust.placeOrder(foodName,self.empl)
  7.  
  8. def result(self): # узнаем у клиента название блюда
  9. self.cust.printFood()
  10.  
  11. def __init__(self):
  12. self.food = None
  13.  
  14. def placeOrder(self, foodName, employee):
  15. self.food = employee.takeOrder(foodName)
  16.  
  17. def printFood(self):
  18. print(Food(self.food))
  19.  
  20. def takeOrder(self, foodName): # возвращаем блюдо с требуемым названием
  21. return Food(foodName)
  22.  
  23. def __init__(self, name): # сохраняем название блюда
  24. self.name = name
  25.  
  26. x = Lunch()
  27. x.order('burritos')
  28. x.result()
Add Comment
Please, Sign In to add comment