Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. def breakfast():
  2. item = 'a'
  3. total = 0
  4. while item != 'q':
  5. item = input("Enter item (q to terminate): egg, bacon, sausage, hash brown, toast, coffee, tea: ")
  6. item = item.lower()
  7. if item != 'egg' and item != 'bacon' and item != 'sausage' and item != 'hashbrown' and item != 'toast' and item != 'coffee' and item != 'tea' and item!= 'q':
  8. print("This is not a valid item to order!")
  9. else:
  10. quan = float(input("Enter quantity :"))
  11. if item == 'egg':
  12. total = .99*quan
  13. elif item == 'bacon':
  14. total = 0.49*quan
  15. elif item == 'sausage' :
  16. total = 1.49 *quan
  17. elif item == 'hashbrown' :
  18. total == 1.19*quan
  19. elif item == 'toast':
  20. total == 0.79*quan
  21. elif item == 'coffee':
  22. total == 1.09*quan
  23. elif item == 'tea':
  24. total == 0.89*quan
  25. print("cost = " + str(total))
  26. tax = total*0.13
  27. print("Tax = " + str(tax))
  28. totals = total+tax
  29. print("Total = "+ str(totals))
  30.  
  31. breakfast()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement