Question: Design an algorithm and a code to simulate a money exchange between the costumer and the vendor. Every time customer gives a money, algortihm should
Design an algorithm and a code to simulate a money exchange between the costumer and the vendor. Every time customer gives a money, algortihm should calculate how much money should be given back as the change. The purchase amount and the customer moneyshould be given at the beginning. The algorithm should give the coin amounts. Example: Purchase is $ customer gives $ then the algorithm should tell the vendor to give back $ to the customer.After you finish your coding, you should simulate all three possible scenarios and show the outputs one by one:Customer gives less money than the purchase amount. In this case, give a warning like "The money is not enough".Customer gives exact money as the purchase amount. In this case, the output will be zeroCustomer gives more money than the purchase amount. In this case, the output will be the change amount as in the example aboveFor this question, identify the inputs and outputs for the code. Identify the mathematical expression for the problem. Finally put all in MATLAB language.Identify what are the different possible scenarios and how to code those.You don't have to report your algorithm you will submit only your Matlab code.You have minutes to finish this task, you should submit it before the session ends. Late submissions will not be evaluated.Good luck
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
