Advertisement
Guest User

burger.py

a guest
Oct 20th, 2019
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.95 KB | None | 0 0
  1. disc = 0.20
  2. to_go_cost = 1
  3. hb_types = ['No burger', 'Hamburger Jr',
  4.             'Hamburger Regular', 'Hamburger Super']
  5. hb_price = [0, 5.95, 7.95, 9.99]
  6.  
  7. ff_types = ['No French fries', 'French fries Jr',
  8.             'French fries Regular', 'French fries Super']
  9. ff_price = [0, 1.25, 1.75, 2.50]
  10.  
  11. shake_types = ['No shake', 'shake Jr', 'shake Regular', 'shake Super']
  12. shake_price = [0, 1.75, 2.75, 3.75]
  13.  
  14. for hb in range(len(hb_types)):
  15.     print(str(hb) + ".", end=' ')
  16.     print(hb_types[hb] + " $", end='')
  17.     print(hb_price[hb])
  18. burger = int(input("Please select burger:\n"))
  19.  
  20. if burger != 0:
  21.     hb_qty = int(input("How many?\n"))
  22. else:
  23.     hb_qty = 0
  24.  
  25.  
  26. for ff in range(len(ff_types)):
  27.     print(str(ff) + ".", end=' ')
  28.     print(ff_types[ff] + " $", end='')
  29.     print(ff_price[ff])
  30. fries = int(input("Please select fries:\n"))
  31. if fries != 0:
  32.     ff_qty = int(input("How many?\n"))
  33. else:
  34.     ff_qty = 0
  35.  
  36. for sk in range(len(shake_types)):
  37.     print(str(sk) + ".", end=' ')
  38.     print(shake_types[sk] + " $", end='')
  39.     print(shake_price[sk])
  40. shake = int(input("Please select fries:\n"))
  41. if shake != 0:
  42.     sk_qty = int(input("How many?\n"))
  43. else:
  44.     sk_qty = 0
  45.  
  46. togo = input(f"\nA to go order cost additional ${to_go_cost}.\nIs this a to go order?(enter Y for yes or N for no)\n")
  47.  
  48. if togo.upper() == 'N':
  49.     to_go_cost = 0
  50.  
  51. coupon = int(input("If you have a coupon, enter the coupon value else enter 0\n"))
  52.  
  53. burgerCost = hb_price[burger] * hb_qty
  54. friesCost = ff_price[fries] * ff_qty
  55. shakeCost = shake_price[shake] * sk_qty
  56.  
  57. grossCost = (burgerCost + friesCost + shakeCost)
  58.  
  59. if burger == fries == shake:
  60.     discValue = grossCost * disc
  61. else:
  62.     discValue = 0
  63.  
  64. netCost = grossCost - discValue - coupon + to_go_cost
  65.  
  66.  
  67. print(f"gross cost {grossCost:.2f}")
  68.  
  69.  
  70. print(f"discount value  {discValue:.2f}")
  71.  
  72. print(f"coupon amount {coupon:.2f}")
  73.  
  74. print(f"to go cost {to_go_cost:.2f}")
  75. print(f"net cost {netCost:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement