programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Jeanne Boyarsky
• Ron McLeod
• Paul Clapham
• Liutauras Vilda
Sheriffs:
• paul wheaton
• Rob Spoor
• Devaka Cooray
Saloon Keepers:
• Stephan van Hulst
• Tim Holloway
• Carey Brown
• Frits Walraven
• Tim Moores
Bartenders:
• Mikalai Zaikin

# Assignment 4b question

Ranch Hand
Posts: 161
• Number of slices to send:
Optional 'thank-you' note:
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

village idiot
Posts: 1208
1
• Number of slices to send:
Optional 'thank-you' note:
By creating and/or extending a pattern that will accommodate numbers up to a billion.

Gary Ba
Ranch Hand
Posts: 161
• Number of slices to send:
Optional 'thank-you' note:
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
Posts: 1208
1
• Number of slices to send:
Optional 'thank-you' note:
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.

Sheriff
Posts: 1367
18
• Number of slices to send:
Optional 'thank-you' note:
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
• Number of slices to send:
Optional 'thank-you' note:
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.

 Consider Paul's rocket mass heater.