Advertisement
Guest User

Untitled

a guest
Feb 5th, 2018
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.92 KB | None | 0 0
  1.  
  2. # shipping constatns
  3. shipping_usa1 = float(6.00)
  4. shipping_usa2 = float(9.00)
  5. shipping_usa3 = float(12.00)
  6.  
  7. shipping_canada1 = float(8.00)
  8. shipping_canada2 = float(12.00)
  9. shipping_canada3 = float(15.00)
  10.  
  11. shipping_cost_print = float()
  12.  
  13. #Get input
  14. item_name = str (input("Please enter the item name: "))
  15. fragle = str (input("is the item fragle? y/n: "))
  16. total = float (input("Please enter your order total: $  "))
  17. destination =str (input("Please enter the destination: usa/can "))
  18.  
  19.  
  20. #Figure out if's going to usa or can
  21. if destination == ("usa"):
  22.     if total <= 50.00:
  23.         total += shipping_usa1
  24.         shipping_cost_print = shipping_usa1
  25.     elif total >50.01 and total <=100.00 :
  26.         total += shipping_usa2
  27.         shipping_cost_print = shipping_usa2
  28.     elif total >100.01 and total <=150.00 :
  29.         total += shipping_usa3
  30.         shipping_cost_print = shipping_usa3
  31.     elif total >=150.01:
  32.         total += 0.00
  33.         shipping_cost_print = 0.00
  34.  
  35.        
  36.  
  37. if destination == ("can"):
  38.     if total <= 50.00:
  39.         total += shipping_canada1
  40.         shipping_cost_print = shipping_canada1
  41.     elif total >50.01 and total <=100.00 :
  42.         total += shipping_canada2
  43.         shipping_cost_print = shipping_canada2
  44.     elif total >100.01 and total <=150.00 :
  45.         total += shipping_canada3
  46.         shipping_cost_print = shipping_canada3
  47.     elif total >=150.01:
  48.         total += 0.00
  49.         shipping_cost_print = 0.00
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56. # if orde is fragle add 2.00
  57.  
  58. if fragle == ('y'):
  59.     total += (2.00)
  60.  
  61. print('++++++++++++++++++++++++++++++++++++++++++++++++++++++++')
  62. print("your order is: ", item_name)
  63. print("Your shipping cost is: ", '{0:.2f}'.format(shipping_cost_print))
  64. print("You are shipping to: ", destination)
  65. print("Your total shipping cost is ",'{0:.2f}'.format(total))
  66. print('++++++++++++++++++++++++++++++++++++++++++++++++++++++++')
  67. print("Thank you for your order.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement