Question: Please help! Write a program that tells what coins to give out for any amount of change from 1 cent to 99 cents. For example,
Please help!


Write a program that tells what coins to give out for any amount of change from 1 cent to 99 cents. For example, if the amount is 86 cents, the output would be something like the following: 86 cents can be given as 3 quarters, 1 dime, 1 penny. Use coin denominations of 25 cents (quarters), 10 cents (dimes), and 1 cent (pennies). Do not use nickel and half-dollar coins. Your program should use the following function (among others): void compute_coins(int coin_value, int& num, int&amount_left) // Precondition: 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
