Cambridge IGCSE 0478 & 0984 Computer Science Pseudocode Guide
The definitive Paper 2 preparation guide for Cambridge IGCSE Computer Science. Master algorithm design, input validation, trace tables, and the crucial 15-mark extended scenario question.
Paper 2 Overview (Algorithms & Programming)
Paper 2 accounts for 50% of your total IGCSE Computer Science qualification. Writing precise, mark-scheme compliant pseudocode is essential for achieving an A* (Grade 9).
1. The 15-Mark Extended Scenario Question: 5-Step Formula for Top Marks
The 15-mark question at the end of Paper 2 is where candidates either secure their A* or lose up to 12 marks. Examiners assess five core algorithm requirements. Follow this 5-step blueprint:
Step 1: Declare All Variables & 1D Arrays at the Top (2–3 Marks)
Never introduce variables midway without declaring them. Look at the scenario requirements and declare fixed arrays with clear 1-based bounds (e.g. ARRAY[1:50]) and descriptive identifiers.
DECLARE StudentName : ARRAY[1:50] OF STRING
DECLARE StudentMark : ARRAY[1:50] OF INTEGER
DECLARE Total : INTEGER
Step 2: Initialize Accumulators & Flags Before Loops (2 Marks)
Initialize all totals, counters, highest/lowest trackers, and boolean flags before opening iteration loops. Failing to set Total ← 0 or Highest ← -1 is heavily penalized.
Total ← 0
PassCount ← 0
Highest ← -1
Step 3: Implement Post-Condition Input Validation (3–4 Marks)
Scenarios always demand validating user input within a defined range (e.g. mark between 0 and 100) or checking for specific choices. Always use a REPEAT...UNTIL loop with an error prompt.
REPEAT
OUTPUT "Enter exam mark (0 to 100): "
INPUT Mark
UNTIL Mark >= 0 AND Mark <= 100
Step 4: Use Parallel Arrays & Traversal Loops (3–4 Marks)
Store student names and marks in parallel index positions using a count-controlled FOR loop from 1 to N, updating running totals inside the loop.
FOR i ← 1 TO 50
Total ← Total + StudentMark[i]
IF StudentMark[i] >= 50 THEN
PassCount ← PassCount + 1
ENDIF
NEXT i
Step 5: Output Formatted Results with Contextual Labels (2 Marks)
Calculate the average (Average ← Total / 50) and print every requested summary statistic with descriptive strings. Do not simply print raw numbers!
OUTPUT "Class Average Mark: ", Average
OUTPUT "Number of Students Passed: ", PassCount
2. Official Cambridge 0478 Pseudocode Keyword & Syntax Checklist
Ensure you use only official CAIE keywords in Paper 2 answers. Avoid informal programming jargon:
DECLARE <id> : <type>
Types: INTEGER, REAL, CHAR, STRING, BOOLEAN
CONSTANT <id> = <value>
Example: CONSTANT MaxMarks = 100
Identifier ← Expression
Always use left arrow ←. Never use single equals =
INPUT <id>OUTPUT <expr>
Separate multiple expressions with commas
FOR i ← 1 TO N ... NEXT i
Optional STEP clause for non-unit increments
WHILE <cond> DO ... ENDWHILE
Condition tested before loop body execution
REPEAT ... UNTIL <cond>
Body executes at least once; exits when True
IF <cond> THEN ... ELSE ... ENDIF
Use CASE OF <id> ... OTHERWISE ... ENDCASE for multiple values
OPENFILE "f.txt" FOR READREADFILE "f.txt", DataCLOSEFILE "f.txt"
Check EOF with WHILE NOT EOF("f.txt") DO
3. Standard Cambridge Algorithms: Counting, Totals, Max/Min & Bubble Sort
Every Paper 2 exam tests one or more standard syllabus algorithms. Be prepared to reproduce these by memory:
- Counting & Totaling:
Count ← Count + 1andTotal ← Total + Scoreinside a loop. - Finding Maximum / Minimum: Initialize
Highest ← Array[1]and compare inside a loop:FOR i ← 2 TO N IF Array[i] > Highest THEN Highest ← Array[i] HighIndex ← i ENDIF NEXT i - Bubble Sort: Outer
REPEAT...UNTIL Swapped = FALSEloop with innerFOR i ← 1 TO N - 1loop comparing adjacent elements and swapping via a temporary variable (Temp ← List[i]). - Linear Search: A loop scanning an array sequentially until the target value matches or the array boundary is reached.
4. Top 5 Examiner Traps That Cost Marks on IGCSE Paper 2
- Using 0-Based Array Indexing: Cambridge 0478 arrays are 1-based by default. Writing
FOR i ← 0 TO 9for an array declared[1:10]loses the array traversal mark. - Using Single Equals for Assignment: Writing
X = Y + 1instead ofX ← Y + 1. In Cambridge pseudocode,=is strictly an equality comparison operator. - Failing to Close Blocks: Leaving out
ENDIF,NEXT i,ENDWHILE, orENDCASEwill cost syntax marks. - Division Confusion (DIV vs MOD vs /): Remember that
/performs real division (with decimal fractions),DIVperforms integer division (quotient only), andMODyields the remainder. - Overwriting Variables in File Loops: Forgetting to process or accumulate the variable read from a file before the next
READFILEoverwrites it.
5. Frequently Asked Questions: Cambridge IGCSE 0478 Pseudocode
How do I write pseudocode that gets full marks on the 15-mark question?
Declare all variables and arrays at the top, initialize accumulators, validate inputs using a REPEAT...UNTIL loop, use descriptive variable names, and provide clear output prompts matching all bullet points in the question.
Is Cambridge O-Level 2210 pseudocode the same as IGCSE 0478?
Yes. Cambridge O-Level 2210 shares the identical pseudocode syllabus and Paper 2 mark schemes as IGCSE 0478. You can use our O-Level 2210 Guide as well.
Can I run my Cambridge IGCSE pseudocode online to check for errors?
Yes! Test your algorithms inside the PseudoStudio Online Compiler. Our cloud engine compiles Cambridge syntax with real-time error messages, interactive terminal input, and trace tables.
Where can I practice IGCSE Paper 2 pseudocode past papers?
Visit our AI Practice Workspace, which features 200+ Cambridge IGCSE questions categorized by topic (loops, arrays, file handling) with automated AI mark-scheme grading.
Get Exam Ready with Interactive 0478 Practice
Test your pseudocode against real test cases, dry-run trace tables, and receive instant marks before exam day.