Computer Science, asked by mohammedbasim74731, 8 months ago

Algorithm =TO BUY ICE CREAM FROM THE SHOP

Answers

Answered by ORMgenius
0

a) Check for yr money.

b) choose a path to the icecream shop.

c) after reaching the shop, ask the owner for 1 icecream and its price.

d) check yr money, Subtract the price of the icecream from yr money.

if the result is 0 then u pay all of yr money to the owner and bring the icecream to yr home.

if the result is a positive no. then pay the money to the owner after subtracting the result from yr total money and bring the icecream to yr home.

else if the result is a negative no. you who head to yr home again, and bring the sum of money that is yr first totall money+the result, to the shop again and follow the loop

Similar questions