Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PRICE = 14.99
- SHIPPING_COST = 0.89
- ONLINE_CHARGE = 1.50
- TAX_RATE = 0.13
- def get_number_of_pounds():
- number_of_pounds = int(input("Enter pounds of coffee: \n"))
- return number_of_pounds
- def price_of_coffee():
- return round(pounds * PRICE, 2)
- def price_of_shipping():
- shipping_charges = round((pounds * SHIPPING_COST) + ONLINE_CHARGE, 2)
- return shipping_charges
- def price_of_tax():
- tax = round((subtotal + shipping) * TAX_RATE, 2)
- return tax
- def grand_total_price():
- return round(subtotal + shipping + taxprice, 2)
- def receipt_of_purchase():
- print('-'*32)
- print(pounds, 'lbs @', PRICE, '/ lb\t\t$', subtotal)
- print('Shipping:\t\t\t\t$', shipping_charges)
- print('Tax:\t\t\t\t\t$', taxprice)
- print('-'*32)
- print('Total:\t\t\t\t\t$', total)
- print('-'*32)
- if __name__ == "__main__":
- pounds = get_number_of_pounds()
- subtotal = price_of_coffee()
- shipping = price_of_shipping()
- taxprice = price_of_tax()
- total = grand_total_price()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement