Question: In C++ Write the code for a function called computeChange that will determine how many quarters, dimes, and nickels will be returned to the customer
In C++

Write the code for a function called computeChange that will determine how many quarters, dimes, and nickels will be returned to the customer for the purchase of a Vendltem in Question 3. Assume the globally declared array changeCoins always hold the 3 values for the change coin categories. Position O will be the number of quarters in the change, position 1 will be the number of dimes in the change, and position 2 will be the number of nickels in the change. The function is passed the price of the item and the cash tendered for the item. (HINT An algorithm could be to subtract 25 cents from the change repeatedly until less than 25 cents remains, then subtract 1O cents repeatedly, then 5 cents, counting each successful subtraction in the appropriate position of the array.) const int COIN-TYPES = 3; int changecoins[COIN TYPES]://globally declared and accessible void computeChange(double price, double cash)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
