Write a program to input cost of purchased item calculate and print discounton following criteria.
COST
Less than or equal to Rs 10000
More than Rs 10000 and less than or equal to 20000
More than Rs 20000 and less than or equal to 35000
More than 35000
DISCOUNT(in percentage)
5%
10%
15%
20%
Answers
Answered by
14
The following codes are written in Python.
cost = float(input("Enter the cost of your purchase: "))
print()
if cost <= 10000:
print("You receive a discount of 5%.")
tc = cost - (cost*0.05)
print()
print(tc, "is your total amount.")
elif cost > 10000 and cost <= 20000:
print("You receive a discount of 10%.")
tc = cost - (cost*0.10)
print()
print(tc, "is your total amount.")
elif cost > 20000 and cost <= 35000:
print("You receive a discount of 15%.")
tc = cost - (cost0.15)
print()
print(tc, "is your total amount.")
elif cost = 35000:
print("You receive a discount of 20%.")
tc = cost - (cost*0.20)
print()
print(tc, "is your total cost.")
Similar questions