Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.96 KB | None | 0 0
  1. PRICE = 14.99
  2. SHIPPING_COST = 0.89
  3. ONLINE_CHARGE = 1.50
  4. TAX_RATE = 0.13
  5.  
  6. def get_number_of_pounds():
  7.     number_of_pounds = int(input("Enter pounds of coffee: \n"))
  8.     return number_of_pounds
  9.  
  10. def price_of_coffee():
  11.     return round(pounds * PRICE, 2)
  12.  
  13. def price_of_shipping():
  14.     shipping_charges = round((pounds * SHIPPING_COST) + ONLINE_CHARGE, 2)
  15.     print('-'*32)
  16.     print('Shipping:\t\t\t\t$', shipping_charges)
  17.     return shipping_charges
  18.  
  19. def price_of_tax():
  20.     tax = round((subtotal + shipping) * TAX_RATE, 2)
  21.     return tax
  22.  
  23. def grand_total_price():
  24.     return round(subtotal + shipping + taxprice, 2)
  25.  
  26. def receipt_of_purchase():
  27.     print('Tax:\t\t\t\t\t$', taxprice)
  28.     print('-'*32)
  29.     print('Total:\t\t\t\t\t$', total)
  30.     print('-'*32)
  31.  
  32. if __name__ == "__main__":
  33.     pounds = get_number_of_pounds()
  34.     subtotal = price_of_coffee()
  35.     shipping = price_of_shipping
  36.     taxprice = price_of_tax()
  37.     total = grand_total_price()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement