Write a program that dispenses change. The program should read the amount of the purchase and the amount paid and then display the number of dollars, quarters, dimes, nickels, and pennies given in change. (Hint: Convert the purchase amount and the amount paid to pennies.) Calculate the difference (changeDue). Use the % operator to determine how many dollars to pay. Subtract that number of pennies from changeDue and continue this process for quarters, dimes, etc. Your answer may be off by a penny. Do you have any idea why this might be the case? How could you correct this?
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.