Answer to Question #300098 in Python for Christine

Question #300098

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



1
Expert's answer
2022-02-20T01:47:00-0500
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}")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS