Past paper – IGCSE Computer Science (0478)

Cambridge IGCSE · 0478

Computer Science · Paper 23

May/June 2026 · 0478/23/M/J/26

Questions10
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/23/M/J/26 · Question 1May/June 2026Paper 231 marks
Loading question…
Question text

1
Tick (3) one box to complete this sentence.
A standard method of solution used for adding together a set of values during iteration is
A
counting.
B
searching.
C
sorting.
D
totalling.
[1]

2
0478/23/M/J/26 · Question 2May/June 2026Paper 231 marks
Loading question…
Question text

2
Tick (3) one box to identify a programming data type used to store any combination of letters
and numbers.
A
char
B
Boolean
C
string
D
real
[1]

3
0478/23/M/J/26 · Question 3May/June 2026Paper 2311 marks
Loading question…
Question text

3
(a) Identify the type of test data in each description.
(i)
Data that falls within the accepted parameters of a validation check and is accepted.
… [1]
(ii)
Data that is the highest or lowest value to be accepted.
… [1]
(b) Explain the purpose of a check digit and give an example of where it could be used.
purpose …
…
…
…
…
example …
[3]
© Cambridge University Press & Assessment 2026
,
,
(c) Write the pseudocode for an algorithm to perform a validation check and a verification check
on a new password to meet the following criteria:
1
Input a new password.
2
If the password is less than 10 characters in length, ask for it to be input again until it is
at least 10 characters in length.
3
If the password is at least 10 characters in length, ask for it to be input a second time.
4
If both inputs of the new password match, output a password accepted message.
5
If both inputs of the new password do not match, go back to step 1 and ask for the new
password to be input for the first time.
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.
…
…
…
…
…
…
…
…
…
…
…
…

Advertisement
4
0478/23/M/J/26 · Question 4May/June 2026Paper 2310 marks
Loading question…
Question text

4
This pseudocode algorithm is intended to store the names of up to 250 runners who finish a race.
The names of the runners are stored in a one‑dimensional (1D) array Runners[] and their time
in seconds in a one‑dimensional (1D) array Times[]. After the time for each runner has been
entered into the array, the name of the runner and the time of the runner in minutes and seconds
are displayed for verification.
Each runner takes 60 minutes or less to finish the race. A time of 60 minutes would be entered as
3600 seconds.
01
DECLARE Runners : ARRAY[1:250] OF STRING
02
DECLARE Times : ARRAY[1:250] OF INTEGER
03
DECLARE Index : INTEGER
04
DECLARE RunName : STRING
05
DECLARE RunTime : STRING
06
DECLARE RunMins : INTEGER
07
DECLARE RunSecs : INTEGER
1 TO 250
08
FOR Index
09
OUTPUT "Enter a runner’s name and then time (in seconds) "
10
INPUT RunName
11
OUTPUT RunTime
DIV(RunTime, 60)
12
RunMins
DIV(RunTime, 60)
13
RunSecs
14
OUTPUT "Runner’s Name: ", RunName
15
OUTPUT "Time: ", RunMins, " Minutes ", RunSecs, " Seconds"
RunMins
16
Runners[Index]
RunTime
17
Times[Index]
18
NEXT Index
(a) Identify the line numbers of four 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 …
…
[4]
© Cambridge University Press & Assessment 2026
,
,
(b) The algorithm is intended to work for positive finish times that are 3600 seconds or less, but
any number of seconds can currently be input.
(i)
Write the pseudocode statements to show how you would change the algorithm so that
only times in the correct range could be input. The time taken to finish the race needs to
be input again until valid data is input.
Clearly state where in the original algorithm your new statements would be placed.
Do not rewrite the whole algorithm.
…
…
…
…
…
…
…

5
0478/23/M/J/26 · Question 5May/June 2026Paper 237 marks
Loading question…
Question text

5
This flowchart represents an algorithm.
START
PassCount
0
FailCount
0
Count
0
INPUT Size
No
Yes
IS Size <
50.0 ?
PassCount
PassCount + 1
FailCount
FailCount + 1
Count
Count +
1
No
IS Count = 9
?
Yes
OUTPUT "Number
passed: ", PassCount
OUTPUT "Number
failed: ", FailCount
STOP
© Cambridge University Press & Assessment 2026
,
,
(a) Complete the trace table for the algorithm, using the input data:
49.8, 48.7, 62.5, 49.9, 30.0, 58.2, –12.5, 50.0, 26.7, – 49.2, 58.9
PassCount
FailCount
Count
Size
OUTPUT
[5]
(b) Describe how you would change the flowchart to prevent negative numbers from being input.
…
…
…
… [2]
© Cambridge University Press & Assessment 2026

6
0478/23/M/J/26 · Question 6May/June 2026Paper 235 marks
Loading question…
Question text

6
The string "I learnt to program in computer science" will be stored in the
variable Fact
(a) Complete the pseudocode algorithm to:
•
calculate and output the length of the string stored in the variable Fact
•
output, in upper case, the string stored in the variable Fact
"I learnt to program in computer science"
Fact
…
…
…
… [3]
(b) Write the pseudocode statements to use a string function to output the word program taken
from the string stored in the variable Fact
Do not declare any variables.
…
…
…
… [2]
© Cambridge University Press & Assessment 2026

7
0478/23/M/J/26 · Question 7May/June 2026Paper 238 marks
Loading question…
Question text

7
Consider the logic expression:
X is 1 if (P = NOT 1 AND Q = 1) XOR (Q = 1 NOR R = 1)
(a) Draw a logic circuit for the given logic expression.
Each logic gate must have a maximum of two inputs.
Do not simplify this logic expression.
P
Q
X
R
[4]
(b) Complete the truth table from the given logic expression.
working space
P
Q
R
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/23/M/J/26 · Question 8May/June 2026Paper 2311 marks
Loading question…
Question text

8
A database table OPTION_SUBJECTS stores some data about a number of subjects taken by
students in a college.
field
description
SubjectCode
a code such as CSIG01 to represent the subject and level
SubjectName
the name of the subject, for example computer science
Level
the level of the course, for example IGCSE or A Level
CourseWork
whether or not coursework is included as part of the assessment
PracticalExams
the number of practical exams taken during the course
TheoryExams
the number of theory exams taken during the course
length of the course, for example 1 or 2, representing number
CourseLength
of years
the minimum number of students required for the course to run,
MinimumClassSize
for example 10
the maximum number of students admitted to each class, for
MaximumClassSize
example 30
(a) Identify the most appropriate field in OPTION_SUBJECTS for a primary key.
Give one reason for your choice.
primary key field …
reason …
…
[2]
(b) Identify one appropriate field from OPTION_SUBJECTS for each of the given data types.
State one reason for your choice in each case.
integer data type …
reason …
…
Boolean data type …
reason …
…
[4]
© Cambridge University Press & Assessment 2026
,
,
(c) Complete the structured query language (SQL) statement to list only the subject code,
subject name and level for the minimum class size of less than 10. The results should be
listed in order of subject code, from the lowest to the highest.
SELECT …
FROM …
WHERE …
… ;
[5]

Advertisement
9
0478/23/M/J/26 · Question 9May/June 2026Paper 236 marks
Loading question…
Question text

9
Outline two techniques that can be used to create a maintainable program.
1 …
…
…
…
…
…
2 …
…
…
…
…
…
[6]
© Cambridge University Press & Assessment 2026

10
0478/23/M/J/26 · Question 10May/June 2026Paper 2315 marks
Loading question…
Question text

10 Five rivers show signs of pollution and are to be monitored daily for a period of 30 days.
The one‑dimensional (1D) array RiverNames[] stores the names of the rivers.
The two‑dimensional (2D) array RiverStats[] stores the daily measurement of biological
oxygen demand (BOD) for each river.
The two‑dimensional (2D) array DaysCount[] stores the number of days each river is classed
as moderately polluted and the number of days each river is classed as highly polluted.
The position of the data for any river is the same in all three arrays. For example, the data in
index 2 of RiverStats[] belongs to the river in index 2 of RiverNames[]
Write a program for the following requirements:
•
Input and store the names of the rivers in the array RiverNames[]
•
For each river, input and store in the array RiverStats[], the daily BOD in milligrams per
litre (mg / L) on each of the 30 days.
•
Once all the inputs for the 30 days have been completed, the following statistics are
calculated, and when appropriate, stored:
◦
The average daily reading for each river, rounded to two decimal places.
◦
The number of days in which the BOD reading was between 2 mg / L and 8 mg / L
inclusive (moderate pollution) for each river.
◦
The number of days in which the BOD reading was greater than 8 mg / L (high pollution)
for each river.
•
Output for each river, the average daily BOD readings, the number of days with moderate
pollution and the number of days with high pollution.
•
Find and output the name of the river that has the most days with high pollution.
The program does not need to identify more than one river with an equally high pollution reading.
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.
You will need to initialise the arrays and any variables used for counting or totalling before they
are used.
All inputs and outputs must contain suitable messages.
…
…
…
…
…
…
…
…
© Cambridge University Press & Assessment 2026
,
,
…
…
…
…
…

Advertisement