You are on page 1of 2

INFORMATION TECHNOLOGY

CLASS
Pseudocode uses keywords and control structures similar to those used in programming languages but without
the strict rules of Programming Language (Syntax).

Pseudocodes are written in a form, which looks like a combination of English and a Programming Language.
These are a technique for structured program design that uses English and Mathematical statements to outline
the logic of a program

An Algorithm is a sequence of steps designed to perform a particular task. Algorithms may also be
considered as a step-by-step procedure for solving a problem in a specified amount of time.

An Algorithm may be looked at as a verbal or written description of a logical sequence of actions that is to be
carried out (by a computer).

When you start a car, you follow a step-by-step procedure. The Algorithm looks like this:

1. Insert the key


2. Make sure the gear stick is in park or Neutral
3. Press down on the Gas Pedal
4. Turn the key to the start position
5. If the engine starts within 6 seconds, release the key to the ignition position
6. If the engine does not start in six seconds, release the key, wait ten seconds, and repeat steps 3 – 6, but not
more than five (5) times.
7. If the car does not start, call the garage

NB Without the phrase “but not more than 5 times” in Step 6, you could be trying to start the car forever
because if something is wrong with the car, you would be repeating Steps 3 – 6 over and over again and the
car would still not start. This kind of never-ending situation is an INFINITE LOOP. If we leave out the
phrase “but not more than 5 times” out of Step 6, the procedure does not fit the definition of an Algorithm
because an Algorithm must be terminated in a specified amount of time for all possible conditions.

After an Algorithm is properly structured, the next step is to code it into a Programming Language such as
Pascal, Visual Basic, C++, Basic, Java, etc.

Definition of Important Terms

VARIABLE A variable is a named quantity in Pseudocode whose value can be changed.

NB The value of a variable can be changed by an Input Statement.

CONSTANT a Constant is a value (OR VARIABLE) in a Pseudocode that represents a


value that does not change.

IDENTIFIER An Identifier is the name invented by the Programmer for a data item. An
identifier can be the name of a variable or constant.
DATA TYPE Tells the type of information that can be stored in a variable. Data types include:
 Real- positive and negative whole and decimal number
 Integer- positive and negative whole numbers ONLY
 Char- a single character
 String- a combination of characters
 Boolean- can be two values eg t/f, m/f, y/n

PARTS OF THE PSUEDOCODE ALGORITHM

1. INPUT STATEMENT

The Input Statement is used to get data from outside of the computer via some input device into a variable
for manipulation by the Pseudocode. Keywords for input statements include get, read, accept, input etc.

2. ASSIGNMENT STATEMENT

The Assignment Statement is used to assign/give a value to or change the content (value) of a
variable. The Assignment Statement has two (2) parts – LVALUE and RVALUE.

The LVALUE refers to the variable as the storage location where the RVALUE will be stored. The
RVALUE refers to a value, which may the result of an expression or the content of another variable. The
assignment statements are = and  .

Mathematical Operators

* Multiplication / Division
+ Addition - Subtraction
3. OUTPUT STATEMENT

The Output Statement is used to get information to the Programmer or computer user. Output can take
the form of sound, text, voice, graphics, etc. For output, use the statement Print, output and display.

We will print under the following circumstances:

1. Information between double quotes will be printed as is. E.g. ‘Sum of numbers is’, SUM.
2. When a variable is used with the print statement, the content of the variable is printed. E.g. Print Total
3. Variable not included between quotation mark but separated by a comma. E.g. Print A, B, C.

You might also like