Answer:
In Python:
order = int(input("Order: "))
discount = 0
if(order >= 10 and order <20):
discount = 0.20
elif(order >= 20 and order <50):
discount = 0.30
elif(order >= 50 and order <100):
discount = 0.35
elif(order >= 100):
discount = 0.40
price = order * 4.1
discount = discount * price
print("With your order of "+str(order)+" items, the total value will be $"+str(round(price,2))+" with a discount of $"+str(round(discount,2))+" for a final price of $"+str(round((price-discount),2)))
Explanation:
This prompts the user for number of orders
order = int(input("Order: "))
This initializes the discount to 0
discount = 0
For orders between 10 and 19 (inclusive)
if(order >= 10 and order <20):
-----------discount is 20%
discount = 0.20
For orders between 20 and 49 (inclusive)
elif(order >= 20 and order <50):
-----------discount is 30%
discount = 0.30
For orders between 50 and 99 (inclusive)
elif(order >= 50 and order <100):
-----------discount is 35%
discount = 0.35
For orders greater than 99
elif(order >= 100):
-----------discount is 40%
discount = 0.40
This calculates the total price
price = order * 4.1
This calculates the pre discount
discount = discount * price
This prints the report
print("With your order of "+str(order)+" items, the total value will be $"+str(round(price,2))+" with a discount of $"+str(round(discount,2))+" for a final price of $"+str(round((price-discount),2)))