fred rosenberger wrote:The first thing I'd do is put some System.out.println() statements in the getDimes() method. Print out all the variables at the beginning of the method.
Print out what newdimes is after you calculate it. print out what dimes is inside your method, just before you return it.
I'd comment out the getNickels and getPennies methods (or at least the call to it) until the getDimes works. Once it does work, then fix getNickels before you worry about getPennies.
Ok, so I have commented out all the method calls bar getQuarters and getDimes and did some System.out.println() statement
Paid = 10 which seems fine
owed = 4.12 again fine
newquarters in the getQuarters method works out at 5.88
I have cast newquarters/quarters_value in the getQuarters method and that returns 23, which is correct
However when I then go into the getDimes method and print out the values of newquarters%quarter_value it tells me that newquarters is now 0.0.
How is this so, I have declared newquarters as an instance variable in the class, should the value not remain at 5.88 which is what it was in the previous method?