Matthew Phillips
While testing different versions of my attempts, the error message Array out of bounds' came up a few times too. Usually the problem was that a value passed to the array was bigger than the number of array elements. This had been caused because the program had gone through some calculations to produce the value that was sent to the array, but not in the way I had expected, so a number that was too big for the array resulted.
Again : 123456789012 after the Billions you will have 456789012 remaining etc. So instead of if/else combinations make a method pass it the number and the unit you are trying to print (billion, million, etc)
JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Break the number up in chunks starting left to right.
Are there any Billions ? yes 123 of them - print it.
Are there any Millions ? yes 456 of them - print it.
Are there any Thousands ? yes 789 of them - print it.
Any hundreds - no huh what now ?
Why left to right. Because that�s how we say it
Originally posted by Johannes de Jong:
Rashid if your solution works I suggest you first pass 4a. Then submit 4b and see what "nitpicks" you get back.
Raising Flares debut album 'Ignition' out now
http://www.raisingflares.com
Terry Doyle <br />SCPJ 1.4 , SCWCD , SCMAD(Beta)
Originally posted by Terence Doyle:
I'm waiting to submit all my assignments in order when I get the OK from the nitpickers.
Can I just send it all in?? I'm dreadfully curious about the results of my little home-java 2-day-lock-in session :-D
JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
"Happiness is a way to Travel, <b>Not</b> a Destination" -- Unknown
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |