Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

I need help with writing the code please (c++) because I just started the course...... 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

OpenStudy (rsmith6559):

Start by breaking down the problem. You need to find out how much the purchase is and how much is payed. You need to find out how many dollars in change. Then you could use one function for all of the coin amounts for change. Then output the change.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!