|  |  | 
 
 
 Solving problems on a computer very often requires a repetition of a block of code. Reading in data from a file, outputting to a file or adding numbers are situations where repetition is required. In Lesson A9, Recursion, we have already explored repeating code. However, not all iterative problems lend themselves to recursive solutions. Java provides three alternative constructs for repeating code with the forloop, thewhileloop, and thedo-whileloop. Thewhileandforcontrol structures allow us to set up a conditional loop, one that occurs for an indefinite period of time until some condition becomes false. We will also study the optionaldo-whileloop and the concept of nested loops. The key topics for this lesson are: 
    The while LoopLoop BoundariesConditional Loop StrategiesThe for LoopNested LoopsThe do-while Loop (optional)Choosing a Loop Control StructureLoop Invariants |