Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- def main():
- print("A program to find the cost for three purchased items")
- item1 = input("What is the cost of item 1? ")
- item2 = input("What is the cost of item 2? ")
- item3 = input("What is the cost of item 3? ")
- totalCost = float(item1) + float(item2) + float(item3)
- discount = 0.1 * float(totalCost)
- netCost = float(totalCost) - float(discount)
- print("Cost of 3 items = RM%0.2f\n10%% discount = RM%0.2f\nNet cost = RM%0.2f" % (totalCost, discount, netCost))
- main()
- os.system("pause")
Add Comment
Please, Sign In to add comment