- the body of the loop (which can be one statement or many) keeps executing repeatedly (i.e. looping) while the loop condition remains true.
- the loop condition is the same type of Boolean expression as you find in the if and if...else statements
- the loop condition is evaluated (to see if it's still true or not) every time the loop iterates
- when the loop condition turns to false the loop stops executing and the program continues with the next statements after the loop
- an improperly formed loop can iterate infinitely. (Bad, bad, programmer.)
Homework for today? Why, yes, glad you asked. P149, Qs3, 5, and 6.
No comments:
Post a Comment