Using Loops to find change (Monetary)
Now I'm sure for anyone reading this, this is probably a very easy task to accomplish. For someone as inexperienced with Java as myself, it has proven quite difficult:
use the Remainder operator (%) to tell Joe what exact change he has, example: for $12.35 you would have a ten, a toonie, a quarter, and a dime. This may require a loop within a loop and a little bit of problem solving to figure out!**
The actual change value is $11.18. I know that this is obviously one ten dollar bill, a loonie, a dime, a nickel, and three pennies. My problem is that I have no idea what formulas and whatnot to put into the computer so that it outputs "Joe's Change: and then the different change types indivually. Please keep your answers as simple as possible, as I am REALLY new, and it will look pretty weird in my code if there's a fifty line super high level block of code I obviously didn't write
Thanks in advance!
Re: Using Loops to find change (Monetary)
We aren't going to write code for you, but we'll help you think through the problem.
How do you know that the change is obviously what it is? A big part of programming is taking things that humans "just do" and thinking about the steps involved in the process.
Pretend you have a really dumb friend who has no idea how to make change. Write out a list of instructions (in English, not in code) that your friend could follow to get the job done. Remember how dumb your friend is, so make sure the instructions are as short and simple as possible! When you have that written out, you'll have yourself an algorithm that you can start converting into code.