Answer:
Step-by-step explanation:
The following code is written in Python and creates a function that takes in the price as a parameter and then returns the discount amount to the user as well as printing it to the screen.
def discountAmount(price):
discount = 0
if price >= 5000:
discount = 20
elif price >= 3000:
discount = 15
elif price >= 2000:
discount = 10
elif price >= 1000:
discount = 5
else:
discount = 0
print("Your total discount is " + str(discount) + "%")
return discount