Pseudocode is basically structured natural language. ``Structured''
means there are only a few basic constructs. However, a construct
can be completely embedded in another construct.
The basic constructs are listed as follows:
- Sequence: a sequcne is a list of actions that must be performed
sequentially as specified.
- Conditional Statement: a conditional statement allows the system
to choose from two alternatives based on the outcome of a
condition. A condition must evaluate to either true or false.
- Prechecking Loop: a prechecking loop is a construct for
repetitions. However, before an iteration begins, a condition
must be checked and confirmed to be true.
- Postchecking Loop: a postchecking loop is also a construct for
repetitions. In this case, an iteration is performed, then
an exit condition is evaluated. If the exit condition is false,
another iteration is performed, and so on.
The ability to embed constructs makes pseudocode ``structured''. This
is one advantage of pseudocoding over flowcharting. Furthermore,
it is possible to write pseudocode without a special editor. Best of
all, programmers can insert complete sections of pseudocode as
comments in most programming languages. The last point helps
programmers build programs that are consistent with the system
specifications.
Subsections
Copyright © 2005-05-16 by Tak Auyeung