Guest User

Untitled

a guest
Jul 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import os
  2.  
  3. def main():
  4. print("A program to find the cost for three purchased items")
  5.  
  6. item1 = input("What is the cost of item 1? ")
  7. item2 = input("What is the cost of item 2? ")
  8. item3 = input("What is the cost of item 3? ")
  9.  
  10. totalCost = float(item1) + float(item2) + float(item3)
  11.  
  12. discount = 0.1 * float(totalCost)
  13.  
  14. netCost = float(totalCost) - float(discount)
  15.  
  16. print("Cost of 3 items = RM%0.2f\n10%% discount = RM%0.2f\nNet cost = RM%0.2f" % (totalCost, discount, netCost))
  17.  
  18.  
  19. main()
  20. os.system("pause")
Add Comment
Please, Sign In to add comment