In many situations, the number of times a loop will occur is dependent on some changing condition within the loop itself. The while
control structure allows us to set up a conditional loop, one that occurs for an indefinite period of time until some condition becomes false. In this lesson we will focus on while
loops with some minor usage of nested if
-else
statements inside. Later on in the course you will be asked to solve very complex nesting of selection, iterative, and sequential control structures. The while
loops are extremely useful but also very susceptible to errors. This lesson will cover key methodology issues that assist in developing correct loops.
The key topics for this lesson are: