Professional Documents
Culture Documents
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:
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.
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
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.
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.