(3) Loop pattern. The loop pattern enables the programmer to instruct the
computer to alter the normal (consecutive) sequence and loop back to a previous
statement in the program. In a payroll program, in which the same sequence of
statements is executed for each employee; this eliminates duplication for each
Figure 2-4. Looping pattern: computer loops back to earlier statement.
(4) Branching pattern. The branching pattern allows the programmer to skip
past statements in a program. When all the employee payroll statements have been
processed, for example, the computer can branch to the next set of statements in the
program. Branching is somewhat controversial. When used a lot, it causes the
computer to jump frequently from one part of the program to another, and makes it hard
for other programmers to understand the program.
Figure 2-5. Branching pattern: computer skips past statements.
b. Pseudocode. The pseudocode is a narrative description of the processing
steps used by the programmer in the design phase, to ensure that steps are not left out
or are in error. The pseudocode allows the programmer to zero in on a step without
concern for how it should be phrased in computer language.