Past paper – IGCSE Computer Science (0478)

Cambridge IGCSE · 0478

Computer Science · Paper 22

Feb/March 2026 · 0478/22/F/M/26

Questions9
Marks75
TypeWritten

Answer on paper, open each mark scheme and give yourself marks, then open the Summary.

0 / 0Answer a question to start your score.
Saved 0
Advertisement
1
0478/22/F/M/26 · Question 1Feb/March 2026Paper 221 marks
Loading question…
Question text

1
Tick (3) one box to identify the reason for applying a verification check to input data.
A
To make sure that all the data is in the correct range.
B
To make sure that all the data is accurate.
C
To make sure that no errors have been introduced during input.
D
To make sure that all the data is of the correct length.
[1]

2
0478/22/F/M/26 · Question 2Feb/March 2026Paper 2211 marks
Loading question…
Question text

2
(a) Identify the type of validation check in each description. Each check must be different.
(i)
A check to make sure that data input follows a set pattern such as two letters followed
by three numbers.
… [1]
(ii)
A check to make sure that only whole numbers can be input.
… [1]
(b) Explain the reasons why validation checks are necessary when data is input.
…
…
…
…
…
… [3]
© Cambridge University Press & Assessment 2026
,
,
(c) Write the pseudocode for an algorithm to perform a validation check on each number as it is
input to meet the following criteria:
•
Input 20 numbers, one at a time.
•
If a number is negative, store it in the current element of array NegNumbers[]
•
If a number is not negative, ask for it to be input again until a negative number is input.
•
When all 20 negative numbers have been stored, output a message to state the check
has been completed.
Use appropriate input prompts and output messages to make the requirements clear to
the user.
Do not declare any arrays or variables for this algorithm.
…
…
…
…
…
…
…
…
…
…
…
… [6]
© Cambridge University P

3
0478/22/F/M/26 · Question 3Feb/March 2026Paper 226 marks
Loading question…
Question text

3
The program development life cycle is split into a number of stages.
Describe what happens during the analysis and design stages of the program development
life cycle.
analysis …
…
…
…
…
…
design …
…
…
…
…
…
[6]

Advertisement
4
0478/22/F/M/26 · Question 4Feb/March 2026Paper 221 marks
Loading question…
Question text

4
Tick (3) one box to identify which of the following does not help to create a
maintainable program.
A
Use meaningful identifiers for variable names.
B
Remove blank lines to make the program code shorter.
C
Use procedures and functions.
D
Use the commenting feature provided by the programming languages.
[1]
© Cambridge University Press & Assessment 2026
,
,
© Cambridge University Press & Assessment 2026

5
0478/22/F/M/26 · Question 5Feb/March 2026Paper 2211 marks
Loading question…
Question text

5
This pseudocode algorithm is intended to sort 200 names in ascending order, using a bubble
sort. The last names and first names are stored in separate columns of a two‑dimensional
(2D) array. The last names are stored in column 1 of the array.
01
// The array Names[] has already been declared as
02
// ARRAY[1:200, 1:2] OF STRING and it is already populated
03
DECLARE Row : STRING
04
DECLARE Temp1 : STRING
05
DECLARE Temp2 : STRING
06
DECLARE Swap : BOOLEAN
FALSE
07
Swap
08
WHILE NOT Swap DO
FALSE
09
Swap
2 TO 199
10
FOR Row
11
IF Names[Row, 1] > Names[Row + 1, 1]
12
THEN
Names[Row, 1]
13
Temp1
Names[Row, 2]
14
Temp2
Names[Row + 1, 1]
15
Names[Row, 1]
Names[Row + 1, 2]
16
Names[Row, 1]
Temp1
17
Names[Row + 1, 1]
Temp2
18
Names[Row + 1, 2]
FALSE
19
Swap
20
ENDIF
21
NEXT Column
22
ENDWHILE
(a) Identify the line numbers of five errors in the pseudocode and suggest corrections.
error 1 line number …
correction …
…
error 2 line number …
correction …
…
error 3 line number …
correction …
…
error 4 line number …
correction …
…
© Cambridge University Press & Assessment 2026
,
,
error 5 line number …
correction …
…
[5]
(b) Write the pseudocode for an algorithm, using nested iteration, to output the contents
of Names[]
…
…
…
…
…
…
…
… [4]
(c) Describe a po

6
0478/22/F/M/26 · Question 6Feb/March 2026Paper 2211 marks
Loading question…
Question text

6
This flowchart represents an algorithm.
START
INPUT
Sentence
SentLength
LENGTH(Sentence)
LetterNo
1
Start
1
IS
Yes
SUBSTRING(Sentence,
LetterNo, 1) = " "
?
Word
SUBSTRING(Sentence,
Start, LetterNo – Start)
No
OUTPUT Word, " ",
LENGTH(Word)
Start
LetterNo + 1
LetterNo
LetterNo + 1
Yes
Word
SUBSTRING(Sentence,
No
IS LetterNo =
Start, LetterNo – Start + 1)
SentLength ?
OUTPUT Word, " ",
LENGTH(Word)
STOP
© Cambridge University Press & Assessment 2026
,
,
(a) Complete the trace table for the algorithm, using the given sentence.
Note: the start position of the sentence is index 1.
Sentence
SentLength
LetterNo
Start
Word
OUTPUT
Computing is fun
16
[5]
(b) Explain the purpose of the algorithm shown by the flowchart.
…
…
…
…
…
… [3]
© Cambridge University Press & Assessment 2026
,
,
(c) As currently written, the algorithm may be difficult to understand if it was used as a program.
Identify three improvements that could be made to the algorithm to make it more
user friendly.
…
…
…
…
…
… [3]
© Cambridge University Press & Assessment 2026

7
0478/22/F/M/26 · Question 7Feb/March 2026Paper 228 marks
Loading question…
Question text

7
Consider the logic expression:
X = (A NAND NOT B) XOR (A NOR C)
(a) Draw a logic circuit for this logic expression.
Each logic gate must have a maximum of two inputs.
Do not simplify the logic expression.
A
B
X
C
[4]
(b) Complete the truth table from the given logic expression.
working space
A
B
C
X
0
0
0
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
1
[4]
© Cambridge University Press & Assessment 2026

8
0478/22/F/M/26 · Question 8Feb/March 2026Paper 2211 marks
Loading question…
Question text

8
A database table NATIONAL_TREES stores details of the national trees of some countries from
around the world.
IDCode
Country
Continent
CommonName
ScientificName
EU121
Albania
Europe
Olive
Olea europaea
OC235
Australia
Oceania
Golden wattle
Acacia pycnantha
NO126
The Bahamas
North America
Lignum vitae
Guaiacum sanctum
AS534
Bangladesh
Asia
Mango tree
Mangifera indica
SO326
Brazil
South America
Brazilwood
Caesalpinia echinata
NO124
Canada
North America
Maple
Acer
EU321
Cyprus
Europe
Golden oak
Quercus alnifolia
NA456
Dominican Republic
North America
West Indian mahogany
Swietenia mahagoni
EU652
Finland
Europe
Silver birch
Betula pendula
AS222
India
Asia
Indian banyan
Ficus benghalensis
NO232
Jamaica
North America
Blue mahoe
Talipariti elatum
AF875
Madagascar
Africa
Baobab
Adansonia
OC123
New Zealand
Oceania
Silver fern
Cyathea dealbata
AS498
Philippines
Asia
Narra
Pterocarpus indicus
AF501
South Africa
Africa
Real yellowwood
Podocarpus Iatifolius
SO522
Venezuela
South America
Araguaney
Tabebuia chrysantha
(a) State the number of fields and records in this database table.
fields …
records …
[2]
(b) The data in both IDCode and Country fields are unique in the database table.
State one reason why IDCode would make a better primary key than Country
…
… [1]
© Cambridge University Press & Assessment 2026
,
,
(c) Give the output that would be produced by the structured query language (SQL) statement:
SELECT IDCode, Country, CommonName
FROM NATIONAL_TREES
WHERE Continent = "Europe";
…
…
…
…
…
… [3]
(d) Complete the SQL statement to list only the country, common name and scientific name of
the national trees listed for North America, in alphabetical order of their common names.
SELECT …
FROM …
WHERE …
… ;
[5]
© Cambridge University Press & Assessment 2026

Advertisement
9
0478/22/F/M/26 · Question 9Feb/March 2026Paper 2215 marks
Loading question…
Question text

9
A program is required to enable voting in class surveys, for example to find the most
popular smartphone.
The one‑dimensional (1D) array Options[] is used to store between 2 and 12 options on which
users can vote.
The one‑dimensional (1D) array Votes[] is used to store the votes of between 2 and 1000 users.
The one‑dimensional (1D) array VoteCount[] is used to store the number of votes for each of
the options. The array index represents the option number.
Write a program for the following requirements:
•
Initialise all the arrays before they are used.
•
Input and validate the number of options and the number of voters.
•
Input each of the required options and store them in the array Options[]
•
Display the list of options for each voter and allow each voter to input their preferred option.
Validate this input and store it in the array Votes[]
•
Once all the votes have been input, count the number of voters who chose each option and
find the most and least popular options.
•
Output the most and least popular options as well as the number of voters who selected
each of these options.
The program does not need to identify if two or more options are the equal most or least popular.
You must use pseudocode or program code, and add comments to explain how your code works.
Do not declare arrays, variables or constants for this algorithm; assume this has been done.
Initialisation must be carried out as appropriate.
All inputs and outputs must contain suitable messages.
…
…
…
…
…
…
…
…
…
…
…
…
© Cambridge University Press & Assessment 2026
,
,
…
…
…
…

Advertisement