• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Assignment 4b question

 
Gary Ba
Ranch Hand
Posts: 161
Firefox Browser Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Carol Murphy
village idiot
Bartender
Posts: 1203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By creating and/or extending a pattern that will accommodate numbers up to a billion.
 
Gary Ba
Ranch Hand
Posts: 161
Firefox Browser Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1367
18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 161
Firefox Browser Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic