This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Cattle Drive and the fly likes Calculation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Calculation" Watch "Calculation" New topic
Author

Calculation

Nath Maniedeo
Greenhorn

Joined: Feb 15, 2008
Posts: 29
hi, for assignment 1b, I trying to come up with a simplier calculation than this one below...any ideas?

[code removed]

then I use a for and while loop to print most of the names, and the another while loop to print the remainder...any ideas on how to make the calculation simplier or somewhere I can read how?

thanks..

[Nath: we don't allow code from the assignments here. Would you try to explain what you are thinking without the code?]
[ March 16, 2008: Message edited by: Katrina Owen ]
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
True. You can use pseudocode (code in English rather than Java).

You know you have to write 100 names - that has for loop written all over it. Depending on the width of the name, figure out how many times you will write it per line (we'll call this something like "namesPerLine").

I think you shouldn't need a while loop.
[ March 17, 2008: Message edited by: Marilyn de Queiroz ]

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Calculation
 
Similar Threads
Newton's Method
Halting problem - finite/infinite loops - udecidable problem
Assignment 1B
Help with writing to a file!
PageFormat