In your own wordsQuestion 1 · Recall
Loading…
By the end you can define an algorithm, create an identifier table for a problem, and write pseudocode that clearly separates input, process, and output.
An algorithm is a finite sequence of well-defined, unambiguous steps that solves a specific problem or performs a computation. Key properties:
Algorithms can be expressed in:
Worked example: Algorithm for finding the maximum of three numbers
Find the largest of three input numbers.
An identifier table documents every variable, constant, and data structure used in an algorithm. It ensures clarity and helps with translation to code.
Columns typically include:
| Identifier | Data Type | Purpose | Scope |
|---|---|---|---|
| max | INTEGER | Stores current maximum | Local |
| a, b, c | INTEGER | Input numbers | Local |
| MAX_SIZE | INTEGER | Constant array size | Global |
Good practice:
studentCount not x)temperatureCelsius)Worked example: Identifier table for "calculate average of 5 marks"
A program reads 5 test marks and outputs their average.
The syllabus expects pseudocode with three clear sections:
// INPUT
READ mark1, mark2, mark3, mark4, mark5
// PROCESS
sum = mark1 + mark2 + mark3 + mark4 + mark5
average = sum / 5.0
// OUTPUT
PRINT "Average: ", average
Conventions (Cambridge pseudocode guide):
READ, PRINT, IF, THEN, ELSE, ENDIF, FOR, TO, STEP, WHILE, ENDWHILE, REPEAT, UNTIL← or = (both accepted)//DIV for integer division, MOD for remainderWorked example: Complete pseudocode with identifier table
Convert a temperature from Celsius to Fahrenheit. Formula: F = C × 9/5 + 32