Answer to Question #299943 in Python for Christine

Question #299943

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 2:



GRAPE STORE



No. of Kilos: 3



Total Price: 707.25



Discount: 0.00



Discounted Price: 707.25



CASH: 1000



Change: 292.75







1
Expert's answer
2022-02-20T02:41:00-0500
from dis import disco



COST = 235.75
DISCOUNT = 5
DISCOUNT_KILOS = 5

print('GRAPE STORE')
kilos = float(input('No. of Kilos: '))

tot_price = round(kilos * COST, 2)
if kilos >= DISCOUNT_KILOS:
    discount = tot_price * DISCOUNT / 100
    discount = round(discount, 2)
else:
    discount = 0
discount_price = tot_price - discount

print(f'Total Price: {tot_price:.2f}')
print(f'Discount {discount:.2f}')
print(f'Discount Price: {discount_price:.2f}')

cach = float(input('CACH: '))
change = cach - discount_price
print(f'Change: {change:.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