Pseudocode Notes
Pseudocode Notes
Pseudocode
1. Keywords
a) INTEGER: A whole number
b) REAL: A number capable of containing fractional part
c) CHAR: A single character
d) STRING: A sequence of zero or more characters
e) BOOLEAN: The logical values of True and False
2. Arrays
Arrays are fixed-length lists that store items of the same type. Each item is accessible using an
index number.
Example-
StudentNames[1] “Ali”
NoughtsAndCrosses[2] ‘X’
Values are input using the Input command and, are output using the Output command.
Example-
Input Answer
Output Score
4. Arithmetic operations
a) + Addition
b) – Subtraction
c) * Multiplication
d) / Division
5. IF statements
IF <condition>
THEN
<statements>
ENDIF
IF <condition>
THEN
<statements>
ELSE
<statements>
ENDIF
6. CASE statements
CASE statements allow one out of several branches of code to be executed, depending on the
value of a variable.
Format-
CASE OF <identifier>
...
ENDCASE
CASE OF <identifier>
...
OTHERWISE <statement>
ENDCASE
INPUT Move
CASE OF Move
OTHERWISE : Beep
ENDCASE
Format-
NEXT
Total = 0
RowTotal = 0
FOR Column = 1 TO 10
NEXT Column
Next ROW
Format-
REPEAT
<statements>
UNTIL <condition>
REPEAT
OUTPUT “Please enter a password”
INPUT Password
Format-
WHILE (condition) DO
<statements>
ENDWHILE
Number Number – 9
ENDWHILE