Cambridge IGCSE Pseudocode Rules: The Conventions That Cost Marks
In IGCSE Computer Science 0478, pseudocode is not pseudo-”whatever you like” — Cambridge defines exact conventions, publishes them in the syllabus, and marks against them. Writing Python-flavoured pseudocode in the exam costs marks every single line. This reference collects the rules that decide credit, and the traps that silently eat them.
Declaration and assignment
Declare with a colon, never “AS”:
DECLARE Counter : INTEGER
DECLARE FullName : STRING
CONSTANT PassMark = 50
Assign with the arrow, never ”=”:
Total ← Total + Mark
Conventions around the code: keywords in UPPER CASE (DECLARE, IF, FOR), variable names in PascalCase (Total, MaxMark).
Input and output
INPUT Mark
OUTPUT "Average: ", Average
The two classic cross-language errors: never write PRINT in pseudocode (that’s Python thinking), and never write AS in a declaration (that’s Visual Basic thinking). OUTPUT and INPUT are the only forms.
Every opener needs its closer
| Opener | Closer | Notes |
|---|---|---|
IF … THEN | ENDIF | Even with no ELSE; each nested IF needs its own ENDIF |
WHILE … DO | ENDWHILE | Condition tested before the loop body |
REPEAT | UNTIL <condition> | Condition tested after — loop always runs once |
CASE … OF | ENDCASE | Use OTHERWISE for the default path |
FOR C ← 1 TO 10 | NEXT C | Identifier included — never a bare NEXT |
FOR can take a STEP, including negative: FOR C ← 10 TO 1 STEP −1.
Arithmetic that trips people
- Integer division and remainder use
DIVandMOD:Total DIV Count, and the even-number testIF Num MOD 2 = 0 THEN … - Plain
/produces a REAL result — if the question wants integer output,DIVis the operator being tested. - Type matters at declaration:
Average : REALif the value can be fractional.
Patterns worth having in your hand
Validated input (a recurring Paper 2 pattern):
REPEAT
INPUT Mark
UNTIL Mark >= 0 AND Mark <= 100
Totalling and counting inside a loop, with the running variables declared and initialised before the loop starts — examiners check the initialisation.
Flowcharts: six shapes only
Cambridge specifies the flowchart symbol set — terminator (START/STOP), process, input/output, decision, and the connectors. The exam expects you to read flowcharts (trace them) more often than to draw them from scratch, but the same discipline applies: one shape, one meaning, arrows that show order.
How to drill this properly
- Write by hand. The arrow
←, the colon, UPPER-CASE keywords — muscle memory matters when the notation is unfamiliar. - Convert code you already know. Take a working Python loop and re-express it in Cambridge pseudocode; the translation errors you make are exactly your exam risks.
- Trace with a variable table. For every algorithm: columns for each variable, one row per iteration. Tracing is itself a question type.
- Instant-feedback drilling. Notation errors are binary (right or wrong) — the fastest category to drill with immediate correction. Our smart practice system does exactly this, free with classes.
For the full exam map — papers, topics, revision sequence — see the 0478 complete guide. Sample notes live on the IGCSE notes page; message us to arrange a trial lesson.