Advertisement
lubattillah

modified meal program

May 17th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. order=[]
  2. meal_cost=[]
  3. number_customer=int(input("How many people attended the restaurant?: "))
  4. for client in range(number_customer):
  5. customer_order=input("Meals ordered: ")
  6. costpermeal=int(input("Enter price of "+str(customer_order)+":"))
  7. client+=1
  8. order.append(customer_order)
  9. meal_cost.append(costpermeal)
  10. print("Ordered Meals: ")
  11. for customer_order in order:
  12. print(customer_order)
  13. print("Costs per Meal: ")
  14. for costpermeal in meal_cost:
  15. print(costpermeal)
  16. total = 0
  17. index = 0
  18. for charge in meal_cost:
  19. total+=meal_cost[index]
  20. index+=1
  21. cost_per_person=total/number_customer
  22. print("Meals Cost per person: ",cost_per_person)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement