Write a program to input product code( pc) in character , quantity of the product purchased (qty) and rate of one piece of product (rate) . Calculate the total purchase amount and print it along with the gift to be presented on the following basis:
Amount of purchase(Rs) Gift to be presented
200 and above but less than 700 A key chain
700 and above but less than1200 A carry bag
1200 and above An electric calculator
Answers
Answered by
10
pc = int(input("Enter the product code: "))
qty = int(input("Enter the quantity of product(s) purchased: "))
rate = float(input("Enter the rate of one product: "))
tpa = qty*rate
print(tpa, "of product code:", pc, "is your total amount.")
if tpa > 200 and tpa < 700:
print("Congratulations! You get a free Key Chain!")
elif tpa > 700 and tpa < 1200:
print("Congratulations! You get a free carry bag!")
elif tpa > 1200:
print("Congratulations! You get a free electric calculator!")
else:
print("Are you aware of our ongoing offer?")
print("We're giving away free products depending on how much you've spent!")
print("Go ahead and make another purchase. :)")
print("Thank you for your purchase! We hope to see you again!")
Similar questions