
Update on Money Changer Program
Hello All,
I need to know how I can calculate the probability of how
many WAYS change CAN be given for a certain dollar amount.
For Example:
25 cents CAN be given the following ways:
|=================================================|
|Dollars|FiftyCent|Quarters|Dimes|Nickels|Pennies |
|=================================================|
1 | 0 | 0 | 1 | 0 | 0 | 0 |
|=================================================|
2 | 0 | 0 | 0 | 2| 1 | 0 |
|=================================================|
3 | 0 | 0 | 0 | 2 | 0 | 5 |
|=================================================|
4 | 0 | 0 | 0 | 1 | 3 | 0 |
|=================================================|
5 | 0 | 0 | 0 | 1 | 2 | 5 |
|=================================================|
6 | 0 | 0 | 0 | 1 | 1 | 10 |
|=================================================|
7 | 0 | 0 | 0 | 1 | 0 | 15 |
|=================================================|
8 | 0 | 0 | 0 | 0 | 5 | 0 |
|=================================================|
9 | 0 | 0 | 0 | 0 | 4 | 5 |
|=================================================|
10 | 0 | 0 | 0 | 0 | 3 | 10 |
|=================================================|
11 | 0 | 0 | 0 | 0 | 2 | 15 |
|=================================================|
12 | 0 | 0 | 0 | 0 | 1 | 20 |
|=================================================|
13 | 0 | 0 | 0 | 0 | 0 | 25 |
|=================================================|
So there would be 13 ways to give change for 25cents.
How would I code this?
THX
* Sent from AltaVista http://www.*-*-*.com/ Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful