Computer Science, asked by shinemenot5, 5 months ago

Write algorithm to this problem: Altair goes to market for buying some fruits and vegetables. He is having a currency of Php 500 with him for marketing. From a shop he purchases 2.0 kg Apple priced Php 50.0 per kg, 1.5 kg Mango priced Php 35.0 per kg, 2.5 kg Potato priced Php 10.0 per kg, and 1.0 kg Tomato priced Php 15 per kg. He gives the currency of Php 500 to the shopkeeper. Find out the amount shopkeeper will return to Altair, and also tell the total item purchased.

Answers

Answered by sunitapandia1977
0

sorry baby I don't no the answer

Answered by dreamrob
2

Algorithm

Step 1 : Start

Step 2 : Declare variables P_apple,  P_mango, P_potato, P_tomato, P_total, P_returned

Step 3 : Calculate price paid for 2kg apple

P_apple = 2*50

Step 4 : Calculate price paid for 1.5kg mango

P_mango = 1.5*35

Step 5 : Calculate price paid for 2.5kg potato

P_potato = 2.5*10

Step 6 : Calculate price paid for 1kg tomato

P_tomato = 1*15

Step 7 : Calculate total price buy adding all the prices calculated

P_total = P_apple + P_mango + P_potato + P_tomato

Step 8 : Calculate the amount returned by the shopkeeper

P_returned = 500 - P_total

Step 9 :  Display

Step 10 : Stop

Similar questions