ALGORITHM
. What steps would you follow to buy a chocolate.
Step 1 ; Take money and go to shop.
Step 2; Choose the chocolate of your choice.
Step 3; Pay money to the shopkeeper .
Step 4; Take the balance amount [ if any ]
Finally, you get the desired result, i.e. a chocolate.