Create a Python script which will compute the TOTAL Sales in a Grapes Store. The grapes is sold at 235.75 per kilo. 5% discount is given to customers that will buy 5 kilos and above. Compute also the CHANGE after the customer tendered their money. Format the display with two decimal digits.
Sample Output 1:
GRAPE STORE
No. of Kilos: 3
Total Price: 707.25
Discount: 0.00
Discounted Price: 707.25
CASH: 1000
Change: 292.75
I need the complete coding of this. Thank you
sold = 235.75 # sold at 235.75 per kilo
discount = 0
print("Enter No. of Kilos: ", end='')
kilos = float(input())
print("Enter CASH: ", end='')
cash = float(input())
total = kilos * sold
if kilos >= 5:
discount = total * 0.05 # 5% discount
print()
print("GRAPE STORE")
print(f"No. of Kilos: {kilos:.1f}")
print(f"Total Price: {total:.2f}")
print(f"Discount: {discount:.2f}")
print(f"Discounted Price: {(total - discount):.2f}")
print(f"CASH: {cash:.2f}")
print(f"Change: {(cash - total - discount):.2f}")
Comments
Leave a comment