aspose file tools*
The moose likes Cattle Drive and the fly likes Assignment 4b question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Assignment 4b question" Watch "Assignment 4b question" New topic
Author

Assignment 4b question

Gary Ba
Ranch Hand

Joined: Oct 23, 2009
Posts: 161

Howdy Yall,

I just finished doing assignment #4a and moving on to the next homework. With 4a, there was a pattern on writing the string number 0-99. But with 4b, how can you solve this problem where it is suppose to read 0-billions number??
I tried to see if there is any post about the same problem I am running into. If anyone has an idea, please share.

Garry


star chaser..
Carol Murphy
village idiot
Bartender

Joined: Mar 15, 2001
Posts: 1197
By creating and/or extending a pattern that will accommodate numbers up to a billion.
Gary Ba
Ranch Hand

Joined: Oct 23, 2009
Posts: 161

Argh! This can be done in 40 lines of code. I'm looking for a start. As of now, I do not know how to even start the code with this assignment.

Garry
Carol Murphy
village idiot
Bartender

Joined: Mar 15, 2001
Posts: 1197
Try writing it out in pseudo code. Building off of your work for 4a, what needs to be changed/done completely new to accommodate the higher numbers? What is different when you get to one hundred? One thousand? Take it one step at a time and see if a plan makes itself apparent to you.
Katrina Owen
Sheriff

Joined: Nov 03, 2006
Posts: 1364
    
  17
Also don't worry about how many lines of code it takes.

Make it work first, then work on making the solution more elegant.
Gary Ba
Ranch Hand

Joined: Oct 23, 2009
Posts: 161

Its 3am here and I just finished assignment 4b Say. It's working and I tried to make the code easy to read Well see what my nitpicker say.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Assignment 4b question