Answer to Question #299817 in Python for Dhea M. Maddela

Question #299817

Create a Python script which will compute the TOTAL Sales in 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:

GRAPE STORE:

No. of Kilos: 6

Total Price: 1414.50

Discount: 70.73

Discounted Price: 1343.77

CASH: 1500

Change: 156.23


I need the code to have an output stated above.


1
Expert's answer
2022-02-19T06:22:02-0500

print('Enter the Number Of Kilos:')

no_kilos = int(input())


if no_kilos>=5:

  price= no_kilos*235.75

  discount= round((0.05*price),2)

  disc_price=price-discount

  

  print('GRAPE STORE:')

  print('No. of Kilos:', no_kilos)

  print('Total Price:', price)

  print('Discount:', discount)

  print('Discounted Price:', disc_price)

  print('Enter the Cash Amount:')

  cash = int(input())

  change = cash-price

  print('Cash:', cash)

  print('Change:', change)

else:

  price= no_kilos*235.75

  print('GRAPE STORE:')

  print('No. of Kilos:', no_kilos)

  print('Total Price:', price)

  print('Enter the Cash Amount:')

  cash = int(input())

  change = cash-price

  print('Cash:', cash)

  print('Change:', change)


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