how do I display different numbers of coins

December 23, 2010 at 16:31:11
Specs: Windows 7
I have to create an application that calculates the change a person gets when they input an amount paid and the amount owed, but not only display the change in the application, but also display the amount of dollars, quarters, dimes, nickels, and pennies the change would work out to be.

See More: how do I display different numbers of coins

Report •

December 23, 2010 at 16:32:27
Well that's easy. Take the amount owed, multiply it by 100, and add the text
" pennies" after it.

How To Ask Questions The Smart Way

Report •

December 24, 2010 at 02:51:07
A looping solution is not what you want. quarter = 2 dimes and nickel = 2 dimes and 5 pennies = 1 dime and 3 nickels = 1 dime and 2 nickels and 5 pennies = etc.

dijkstra's algorithm will give the solution with the fewest coins.

Report •
Related Solutions

Ask Question