Cambridge IGCSE Computer Science 0478/22 October/November 2025 (Paper 2 Algorithms, Programming and Logic): Question-by-Question Guide
Cambridge IGCSE Computer Science 0478/22 is the October/November 2025 Paper 2 (Algorithms, Programming and Logic), variant 2. It lasts 1 hour 45 minutes, is worth 75 marks and is sat by every 0478 candidate. It had eight compulsory questions and no calculator, and the final question, a program to test the fairness of a random number generator, carried 15 marks. This guide goes through the paper question by question and shows what the official mark scheme gave marks for. The paper and its mark scheme are free on the Tutopiya Learning Portal.
For the newest series of the same paper, see 0478 Paper 22 May/June 2026: questions and mark scheme.
For an overview of both 0478 papers from this series, see IGCSE Computer Science 0478 Oct/Nov 2025 Papers & Marking.
0478/22 at a glance
Paper codes: the code printed on the cover is 0478/22/O/N/25, the question paper file is 0478_w25_qp_22 and the mark scheme file is 0478_w25_ms_22.
| Question | Topic | Marks | Main command word |
|---|---|---|---|
| 1 | The ^ operator (multiple choice) | 1 | Tick |
| 2 | Contacts search on a 2D array: errors, a procedure, improving the search | 15 | Identify, complete, write, explain |
| 3 | Test data for a range check | 6 | Complete |
| 4 | Length check and an email validation algorithm | 7 | State, write |
| 5 | Code store flowchart: trace table, description, array declaration | 13 | Complete, describe, write |
| 6 | Logic circuit and truth table | 8 | Draw, complete |
| 7 | WATERFOWL database and SQL | 10 | State, complete, give |
| 8 | Random number generator program | 15 | Write |
| Total | 75 |
Question-by-question walkthrough
Question 1: multiple choice (1 mark)
4 ^ 2 means 4 to the power 2, which is 16 (C).
Question 2: searching a contacts array (15 marks)
The algorithm should input a first name, search a 500-row, 4-column array for it, output the rest of that contact’s details, and repeat until the user says stop.
- Five errors (5 marks): the scheme accepted any five of six:
- line 01 declares the array OF REAL, but names and details need OF STRING
- line 12 uses OUTPUT where it should INPUT FirstName
- line 17 outputs Contacts[Row, 1] every time instead of Contacts[Row, Column]
- line 23 uses NEXT where the REPEAT loop needs UNTIL
- Answer is used on lines 25 and 26 but never declared, so DECLARE Answer : CHAR is needed before line 25
- line 28 sets Continue to TRUE where it should be FALSE, so the loop could never end.
- Completing PROCEDURE NewData (4 marks): a parameter in the PROCEDURE line, such as Number : INTEGER (1); the outer loop running FOR Row ← 1 TO Number, which must use Number as the question says (1); INPUT Contacts[Row, Column] (1); and NEXT Column and NEXT Row closing both loops (1).
- Using the procedure (2 marks): an input statement for the number of new contacts (1) and a CALL NewData with that value as the argument (1).
- Why the search may give the wrong result (2 marks): two people may share a first name, or the name may not be in the array; the search stops at the first match and could output the wrong person’s data; and if the name is missing, there may be no output.
- Improving the search (2 marks): add more search criteria to make the search specific to each person, such as a last name, ID number, date of birth, phone number or post code; search the whole array for all matches by removing the stop variable; and check whether the name was found anywhere, outputting a message if it was not.
Question 3: test data (6 marks)
The program accepts values from −99.99 to +99.99 inclusive. One mark per missing box:
| Test data | Type | Purpose |
|---|---|---|
| 0 (given) | normal | to make sure the program accepts data that is in range |
| 100 or −100 | boundary (given) | to make sure the program rejects data on the wrong side of the boundary |
| 300 | abnormal | to make sure the program rejects data outside acceptable limits (given) |
Question 4: validation (7 marks)
-
Purpose of a length check (1 mark): to check that the data entered has the required number of characters.
-
Email @ check (6 marks): six of eight points:
- initialise the start position (and a flag, if used)
- input the email address into a suitable variable
- a working condition-controlled loop
- correct use of SUBSTRING(EmailAddress, Start, 1)
- a condition comparing the extracted character with ’@’
- ending the loop when @ is found
- moving to the next character if it is not, and ending the loop when there are no characters left
- an output for both valid and invalid addresses.
The logic in outline: set Start to 1 and a flag to FALSE; repeat, checking the character at Start and setting the flag if it is @, otherwise adding 1 to Start; stop when the flag is TRUE or Start passes LENGTH(EmailAddress); then output a valid or not-valid message.
Question 5: the code store flowchart (13 marks)
The flowchart inputs a code, rejects it unless it is four characters long, checks it against the six-element array CodeStore[] and either reports that it was used before or stores it in the first empty element. When Count passes 6 it outputs “CodeStore full” and stops.
- Trace table (6 marks, one per column or group): Code, Store and Count each earn a mark; the first four CodeStore columns left unchanged earn one; CodeStore[5] and [6] earn one; and the OUTPUT column earns one. The array starts as aBcd, 1532, Face, 63q8 and two empty elements.
- 7686: Count runs 1 to 6; it is stored in CodeStore[5] and Store becomes TRUE.
- Face: found at Count 3, so the output is “Code used before”.
- Speed: five characters, so the output is “Length must be 4”.
- 432U: Count runs 1 to 7; it is stored in CodeStore[6], then Count reaches 7 and the output is “CodeStore full”. The algorithm stops, so Yp79 is never input.
- Describing the processes (3 marks): any three of: it checks the code is 4 characters long; it checks the code against the array to see if it has been used before; if it passes, the code is stored; it is stored in the lowest available index; and it checks whether the store is full, outputting a message and stopping when it is.
- Declaring and initialising CodeStore[] (4 marks): the array declared with the right name and type, ARRAY[1:6] OF STRING (1); a declared loop counter (1); a loop that runs six times (1); and every element set to the null string "" using the loop counter as the index (1).
Question 6: logic circuit and truth table (8 marks)
X = (J XOR NOT K) NAND NOT L, with a maximum of two inputs per gate and no simplifying.
- Logic circuit (4 marks): one mark for each gate with the right inputs: a NOT gate on K; an XOR gate taking J and NOT K; a NOT gate on L; and a NAND gate combining the XOR output with NOT L to give X.
- Truth table (4 marks): for inputs 000 to 111 in order, X is 0, 1, 1, 1, 1, 1, 0, 1. Four marks for all eight outputs, 3 for six or seven, 2 for four or five and 1 for two or three. A quick check: X is only 0 when L is 0 and J XOR NOT K is 1, which happens when J and K are equal.
Question 7: the WATERFOWL database (10 marks)
- Purpose of a primary key (1 mark): to uniquely identify each record.
- A field for each data type (2 marks): Boolean, CoastalHabitat; Integer, Lifespan; Real, Length or Wingspan; Text, Species or Family. Two marks for all four, one for two or three.
- Output of the swan query (3 marks): one mark each for the right data spelt correctly, a three-column layout with no added punctuation, and the right order:
- Bewick’s swan, 120.2, 190.5 (lifespan 8)
- Whooper swan, 150.0, 230.0 (lifespan 9)
- Mute swan, 150.0, 220.2 (lifespan 10)
- Completing the SQL (4 marks, one per line): SELECT Species, Family, Lifespan; FROM WATERFOWL; WHERE Lifespan >= 10; ORDER BY Species. “At least 10” means >= 10, not > 10.
Question 8: the random number program (15 marks)
The program had to generate 100,000 random integers from 1 to 10 and store them in RandomNumber[], count how often each integer appears and store the counts in the 2D array CountedNumber[], sort that array into descending order of frequency, work out each integer’s chance as frequency ÷ 100000 rounded to four decimal places, and output each integer with its chance. The question gave an example ascending bubble sort on a 2D array, and required comments, declarations for everything and suitable messages.
How it was marked. The scheme grouped the task into three requirements: R1, declaring the arrays and variables and generating and storing the 100,000 integers; R2, counting the frequencies and sorting into descending order; and R3, calculating the chances to 4 decimal places and outputting them. The answer was then placed in a band on two grids, best fit:
- AO2, up to 9 marks (bands 0, 1–3, 4–6, 7–9): the low band needs any programming technique and some data stored; the middle band needs several techniques applied to the scenario and some suitable data structures; the top band needs techniques covering every requirement and data structures that store all the data.
- AO3, up to 6 marks (bands 0, 1–2, 3–4, 5–6): the low band is a program with no relevant comments, some sensible names and many inaccuracies that attempts at least one requirement; the middle band has some comments, mostly meaningful names and attempts most requirements; the top band is fully commented, uses meaningful names throughout, is in a logical order and meets every requirement. Minor syntax errors are ignored.
The logic in outline, following the scheme’s example answer:
loop I from 1 to 100000: RandomNumber[I] ← ROUND(RANDOM() * 9, 0) + 1
loop I from 1 to 10: CountedNumber[I, 1] ← I, CountedNumber[I, 2] ← 0
loop through RandomNumber[], adding 1 to the count for each value
bubble sort CountedNumber[] on column 2, swapping when [I, 2] < [I + 1, 2]
loop I from 1 to 10: output CountedNumber[I, 1] with ROUND(CountedNumber[I, 2] / 100000, 4)
The scheme also accepted generating and counting in the same loop. The one change from the sort you were given is the comparison: swap when the first frequency is smaller, so the largest moves to the top. Keep both columns together when you swap, or the integers and their counts get separated.
Where the marks are on 0478/22
| Skill | Questions | Marks |
|---|---|---|
| Writing a complete program | 8 | 15 |
| Writing and completing algorithms | 2(b), 4(b), 5(c) | 16 |
| Finding errors and improving an algorithm | 2(a), 2(c) | 9 |
| Written theory (test data, validation, flowchart description, primary key) | 3, 4(a), 5(b), 7(a) | 11 |
| Logic circuit and truth table | 6 | 8 |
| Database data types and SQL | 7(b)–(d) | 9 |
| Trace table | 5(a) | 6 |
| Multiple choice | 1 | 1 |
| Total | 75 |
- 31 marks came from writing code, counting Question 8 and the shorter algorithms. Writing pseudocode by hand under time pressure is the core skill this paper tests.
- The trace table, truth table, circuit, test data table, data types and SQL are 29 marks with fixed answers. These are the most reliable marks on the paper.
How to self-mark 0478/22 with the mark scheme
- Mark the short algorithms point by point. For 2(b), 4(b) and 5(c), tick each listed mark point your code contains. Your code does not need to match the example; any logic that does the job earns the point.
- Mark 2(a) by line number and correction. You need both the line and a correct fix, and five of the six errors are enough for full marks.
- Mark the trace table by column. Check that you stopped after 432U: rows for Yp79 mean you missed the STOP.
- Count your correct truth table rows and use the 4-3-2-1 scale. For the circuit, check each of the four gates and its inputs.
- Mark Question 8 against R1, R2 and R3 first. Tick what your program does under each, then pick the AO2 band from how much it covers and the AO3 band from your comments, names and accuracy. Missing declarations, an ascending sort or no rounding all count against you.
- Type and run your Question 8 program with a smaller count, such as 1,000 numbers, to check the frequencies add up and the sort is descending.
Sit 0478/22 as a timed mock
The paper allows 105 minutes for 75 marks. A workable plan that leaves Question 8 its full share:
| Block | Marks | Time |
|---|---|---|
| Question 1 | 1 | 1 minute |
| Question 2 | 15 | 19 minutes |
| Question 3 | 6 | 7 minutes |
| Question 4 | 7 | 10 minutes |
| Question 5 | 13 | 17 minutes |
| Question 6 | 8 | 10 minutes |
| Question 7 | 10 | 11 minutes |
| Question 8 | 15 | 27 minutes |
| Check code and tables | – | 3 minutes |
| Total | 75 | 105 minutes |
Before you start Question 8, list the requirements as a checklist in the margin and tick each one off as you write it.
0478/22 in other series
The May/June 2026 Paper 22 kept the same building blocks: a 15-mark program marked on 9 AO2 and 6 AO3 marks, errors to find in a search of a 2D array, a 6-mark flowchart trace table, a logic circuit with a 4-mark truth table, SQL on a database table and a 6-mark validation algorithm. This paper added a procedure with a parameter and a test data table, where 2026 asked about the coding and testing stages and reading from a file.
Other October/November 2025 0478 papers
Practise and download
- Download 0478/22 and its mark scheme on the Learning Portal →
- All 0478 October/November 2025 papers: overview and marking patterns
- All 0478 May/June 2026 papers: overview and marking patterns
- Try a free IGCSE Computer Science quiz
Need help with a 0478 topic? Book a free trial lesson with an IGCSE Computer Science tutor →
Frequently asked questions
What topics were on 0478 Paper 22 October/November 2025? +
Eight questions: one multiple-choice item on the ^ operator; fixing and extending a search of a 2D contacts array with a procedure; a test data table; a length check and an email validation algorithm using SUBSTRING; a flowchart trace table for a code store; a logic circuit and truth table; a WATERFOWL database with SQL; and a 15-mark program to test a random number generator.
How many marks is 0478/22 and how long is it? +
It is out of 75 marks and lasts 1 hour 45 minutes, with no calculator allowed. Question 8, the random number program, is the biggest at 15 marks, followed by 15 marks across the parts of Question 2.
What were the errors in 0478/22 Question 2(a) Oct/Nov 2025? +
The scheme accepted five of six: line 01 should declare the array OF STRING, line 12 should INPUT FirstName, line 17 should output Contacts[Row, Column], line 23 should be UNTIL rather than NEXT, Answer is never declared (DECLARE Answer : CHAR before line 25), and line 28 should set Continue to FALSE.
What was the truth table answer on 0478/22 Question 6? +
For X = (J XOR NOT K) NAND NOT L, with inputs 000 to 111 in order, X is 0, 1, 1, 1, 1, 1, 0, 1. Four marks for all eight, three for six or seven, two for four or five and one for two or three.
What did the SQL in 0478/22 Question 7(c) output? +
The three swans sorted by lifespan: Bewick's swan 120.2 190.5, then Whooper swan 150.0 230.0, then Mute swan 150.0 220.2. Marks were for the data, the three-column layout with no extra punctuation, and the order.
Where can I download 0478/22 October/November 2025 and its mark scheme? +
Both are free to download and print on the Tutopiya Learning Portal, on the Cambridge IGCSE Computer Science 0478 past papers page.
What is 0478_w25_qp_22? +
0478_w25_qp_22 is the file name of the question paper for Cambridge IGCSE Computer Science 0478 Paper 22 (Paper 2 Algorithms, Programming and Logic, variant 2), October/November 2025. Its mark scheme is 0478_w25_ms_22, and the code printed on the cover is 0478/22/O/N/25. In these file names, w25 means the October/November 2025 series, qp means question paper and ms means mark scheme.
Ready to Excel in Your Studies?
Get personalised help from Tutopiya's expert tutors. Whether it's IGCSE, IB, A-Levels, or any other curriculum — we match you with the perfect tutor and your first session is free.
Book Your Free TrialWritten by
Mahira Kitchil
Connect on LinkedIn →Project Head, Tutopiya
Mahira Kitchil is a Project Head at Tutopiya, where she works with Cambridge IGCSE and Edexcel A-Level teachers in more than 20 countries on how exams are set and marked. She writes practical guides that help students find the right past papers and use the mark scheme the way examiners do, so every practice paper counts.
Related Articles
A Level Biology 9700 Oct/Nov 2025 Papers & Mark Schemes
Free 9700 Oct/Nov 2025 Paper 1 and Paper 3 with mark schemes: the topics tested, the practical tasks and how examiners awarded marks on each.
A Level Computer Science 9618 Oct/Nov 2025 Papers & Marking
Free 9618 Oct/Nov 2025 papers and mark schemes, plus a paper-by-paper breakdown of Papers 1 to 4 and how examiners gave marks for code and theory.
A Level Geography 9696 Oct/Nov 2025 Papers: Topics & Mark Scheme
Free 9696 Oct/Nov 2025 papers, inserts and mark schemes, plus a paper-by-paper breakdown of the data questions, options and essays and how they were levelled.
