Hoooey, that is one complicated calculation! I keep getting lost trying to figure out what's going
on.
Yikes, here too! I'm wondering if you could simplify things with a little help from modulo.
JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
When all at once a mighty herd of red eyed cows he saw...
Originally posted by dav mccartney:
For some reason, I don't like using the modulus. There are points when it seems intuitive to me to use, like 4a, but here, I'm just staring at it, and it's like there's something not fully wired in my brain to make it click as it should.
I'm wondering if you could slim down the method a little by calling parseNumber something like this:
parseNumber( numberIn , oneBillion , " billion " );
While I can understand passing the string in, I'm not sure why I'd pass the oneBillion [...]
Once you've printed the highest group of numbers you're not interested in them anymore, so remove them from the total and continue outputting the lower groups...think about that at least twice, and then have another think about it
... you could probably change it to three [similar] calls, something like
...Usually I prefer that you don't post code here. If you post great code, you will be robbing others of an education...Marilyn
...
JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Don't get me started about those stupid light bulbs. |