Example: Making change

Problem:

Write a program that makes change, i.e. given a number of cents of change to make it will say what coins to use (using as few coins as possible). A sample run might look like:

How much change do you have to make (in cents)? 197
197 cents can be made using:
0 twonies
1 loonies
3 quarters
2 dimes
0 nickels
2 pennies

Solution: