c. Processing. With a clear statement of the desired output developed (in
cooperation with the users and management) and the required input identified, the
programmer can begin to outline processing requirements.
DESIGNING A SOLUTION
a. Basic Logic Patterns. In the design phase, the programmer takes each of
the processing segments uncovered during problem definition (previous step), and
works out a tentative program flow of what needs to be done first, second, and so on.
To develop this tentative flow, the programmer uses the four basic logic patterns of a
computer. There are four basic patterns that a computer can understand and execute:
simple sequence, selection, loop, and branch patterns.
(1) Simple sequence. The simple sequence is the most simple and often-
used pattern. In simple sequence, the computer executes one statement after another
in the order given by the programmer. The computer will assume that all statements
are to be executed in this way, unless told otherwise.
Figure 2-2. Simple sequence pattern: statements executed in order given.
(2) Selection. In selection, the computer must make a choice, based on
whether one item is equal to, less than, or greater than another. (These are the only
comparisons a computer can make. Complex selections are made by using a
sequence of these comparisons.)
Figure 2-3. Selection pattern: computer chooses based on one item being
greater or lesser.