Skip to main content
Lesson 8 - Structured Programming, Control Structures, if-else Statements, Pseudocode
Lesson MenuPreviousNext
  
Control Structures page 4 of 15

  1. There are only three necessary control structures needed to write programs: sequence, selection, and iteration.

  2. Sequence refers to the line-by-line execution as used in your programs so far. The program enters the sequence, does each step, and exits the sequence.

  3. Selection is the control structure that allows choice among different directions. Java provides different levels of selection:

    • One-way selection with an if structure
    • Two-way selection with an if-else structure
    • Multiple selection with a switch structure

  4. Iteration refers to looping. Java provides three loop structures:

    • while loops
    • do-while loops
    • for loops

  5. Of the seven control structures, the if-else and while loop are the most flexible and powerful for problem-solving. The other control structures have their place, but if-else and while are the most common control structures used in Java code.

  6. The diagrams in H.A.8.2, Control Structures in Java, are flowcharts that describe the flow of program control. A statement rectangle in any control structure can be a simple line or even another control structure. A statement can also be a compound statement that consists of multiple statements.


Lesson MenuPreviousNext
Contact
 ©ICT 2003, All Rights Reserved.