This week's book giveaway is in the Design forum.We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!

# Assignment 4b question

Gary Ba
Ranch Hand
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

Carol Murphy
village idiot
Bartender
Posts: 1202
By creating and/or extending a pattern that will accommodate numbers up to a billion.

Gary Ba
Ranch Hand
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
Posts: 1202
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
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
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.