Hello, I was wondering if I could get help with a problem we received in class for fun. We did the first part of it (Break down an amount into change and display it). We haven't touched the problem ever since our teacher gave it to us, but I thought it would be cool to finish it.
The Problem:
Find a way to tell the user the number of possible ways you could have made change for an amount below $10.00. Also, show the number of combinations for ¢25, ¢50, $1, $2, $3, $4, S5, S6, and $10. [The last part is really random to me]
Where I'am stuck:
I been trying to see how i can start to display the number of possible ways to break down the amount. So far, I've looked it up on the internet and the closest thing I found to this was the number of ways possible for one dollar. It used nested FOR loops, so i thought i could apply the same concept for it with any amount below $10.00.
My question is, however, specially if you've seen the problem for $1.00, is how the nested loops help? My understanding is that they divide into the amount being worked on, giving you the number of ways that value can be used to make change that the program is using.
After that, I get stuck on the second part of this problem...any hints? I'am at loss at how to handle that, specially weird amount like $3, $4, $6...My understanding was that I would just display how many times something like $1 went into the amount the program is working with, but now that I have to display $3,4, and 6 I get lost. Does that mean I have to include how many times $3,4, and 6 go into the amount being work on?