Great, thanks again! I'll be frequenting this forum more often with java help =]
Type: Posts; User: iDizzle
Great, thanks again! I'll be frequenting this forum more often with java help =]
So -= is kind of like x++ or x-- from C? I think I will leave my code as is since it is working now but for future reference how would my code have looked if I had implemented the -=?
And again,...
Ok so for the nickel value I changed it to this..
nickel=(int) (((amt-(ten*10)-(five*5)-(one*1)-(quarter*.25)-(dime*.10))+.05)/.05);
I added the .05 there. and now it did give me the correct...
I do not understand the -= operator. I don't believe we have learned that yet. I feel pretty crappy in that class because everyone is a CS/programming major so most people are very familiar with the...
So I was searching online and I found something called "ceiling" or "cover" that might do what I want? Would these algorithms take care of my problem? And if they will, how do I use them?:rolleyes:
Are there any packages or classes than can be included that will do the rounding?
hmmm. Honestly, as you can see, I'm terrible at this. But even I feel like I'm doing this the hard way. If you look at my last code, I feel that I'm relying wayyy too much on math and arithmetic...
uh oh... that's probably why. What can I do about this? =/
Okay. So I worked on it a little more and I think I almost got it. Except the fact that the nickel value is not rounding up. So 35.77 will not give me "1 nickel" from the 2 cents....
Okay so I figured out how to cast a double to an int. But I'm still having trouble with the arithmetic to subtract from the total. If you look at my code below, all it's going to output is change in...
Thank you! Okay i will do a check on the arithmetic. If I change the dollar amounts to int values, wouldn't I have problems because the "amt" is a double value? Would I have to use some kind of data...
Sorry. No errors, I just don't get the output I need.
I get this;
Please enter the amount to be changed
$35.77
Ten dollar bills: 32.193000000000005
Five dollar bills: 28.616000000000003...
Hi everyone. I am a beginner of beginners in Java. I'm not a CS or programming major but I am now taking a Java course because it is required. I look forward to hearing your insight.
I'm working...