Hi there,
When working with while loops there are a few conditions to consider.
In the for loop you can see the initial state, the boolean test and lastly what
happens after each loop.
In the following for loop the initial state is that there is an integer 'i'
equal to the value 0.
Secondly, the test to see whether the loop is executed is that the value of 'i'
is less than 100.
Lastly, at the end of each loop we need to increment 'i' by one.
e.g. for (int i=0;i<100;i++)
This would translate to
int i=0; // initial state
while(i<100) // condition to pass in order to execute the following code block
{
....
i++; // what happens last in each loop, this needs to be before the closing
brace of the loop
}
I know this isn't the most succint explanation however you need to understand
all aspects of the loops before being able to use them.
Hope this helps...Bernie.
Date: Fri, 30 Jan 2009 21:40:55 -0600Subject: [java programming] LAB 1034From:
[email protected]: [email protected] can't
figure out how to do the while loop for this lab. help please!
_________________________________________________________________
Get rid of those unwanted christmas presents! Get what you want at ebay.
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Frover%2Eebay%2Ecom%2Frover%2F1%2F705%2D10129%2D5668%2D323%2F4%3Fid%3D10&_t=763807330&_r=hotmailTAGLINES&_m=EXT
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---