Computer Installation Notes

3. Algorithms and Data structures

3.1. Pseudocode

Pseudocode is a standard method of describing an algorithm without use of any
specific programming language. The word pseudo means that although pseudocode
statements resemble real program code, it cannot be executed by a computer. The
purpose of pseudocode design is to help the programmers formulate their thoughts on
the organisation and sequence of a computer algorithm without the need of following
the actual coding syntax.
Although pseudocode is frequently used, there are no standard for its implementation.
In most cases, we borrow keywords such as PRINT, WRITE, INPUT, and READ
from programming languages like FORTRAN and Pascal to express an algorithm as
a pseudocode. For example, Fig. 7.2 depicts pseudocode that takes radius as input
to calculate and display area of a circle:

To avoid ambiguity experienced with the use of natural languages, the following are
basic rules to be followed when writing pseudocode:
1. Pseudocode statements should be short, clear and readable.

2. The statements must not have more than one meaning i.e. should be unambiguous.
3. The pseudocode lines should be clearly outlined and identified clearly.
4. A pseudocode should show clearly the start and stop of executable statements
5. Input, output and processing statements should be clearly stated, using keywords
such as PRINT, READ, INPUT etc.