Cambridge IGCSE: Computer Science 0478/22
Cambridge IGCSE: Computer Science 0478/22
, ,
Cambridge IGCSE™
¬O. 4mHuOªE^y6W
¬`qR©¥^z}:`hy
¥¥u5uE55EeE UUU
* 2 5 6 1 2 6 5 1 3 6 *
1 hour 45 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (DE/SG) 341750/3
© UCLES 2025 [Turn over
* 0000800000002 *
A bubble sort.
B counting routine.
C linear search.
The pseudocode to store a hotel name held in the variable Name to a text file is
3 Four development life cycle stages and five descriptions are shown.
Draw one line from each stage to the most appropriate description.
Not all descriptions will be used.
coding
using structure diagrams, flowcharts and pseudocode to
plan the solution
[4]
ĬÍĊ®Ġ´íÈõÏĪÅĊßû¸þ×
© UCLES 2025 ĬàđòÓĝġíÕćûÕĘμ²ñĂ
ĥµĥĕõĕąÕąąõąąÕĥĕõÕ
0478/22/F/M/25
* 0000800000003 *
DO NOT WRITE IN THIS MARGIN
3
, ,
............................................................................................................................................. [1]
(i) Identify the validation check used to test whether the value input meets this requirement.
DO NOT WRITE IN THIS MARGIN
Type Check
..................................................................................................................................... [1]
(ii) Write the pseudocode for an algorithm to allow a number to be input into an appropriate
variable and check whether the number is an integer. If the number is an integer, it is
accepted. If the number is not an integer, an error message is output. Re-input of the
number is required until a valid number is input.
INPUT Number
...........................................................................................................................................
WHILE MOD (Number, 1) <> 0 DO
...........................................................................................................................................
OUTPUT ("Error, please enter an Integer")
DO NOT WRITE IN THIS MARGIN
...........................................................................................................................................
INPUT Number
...........................................................................................................................................
ENDWHILE
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
DO NOT WRITE IN THIS MARGIN
..................................................................................................................................... [5]
DO NOT WRITE IN THIS MARGIN
ĬÏĊ®Ġ´íÈõÏĪÅĊßù¸þ×
© UCLES 2025 ĬàĒñÛīĝýäñĆĔÄæĠ²āĂ
ĥµĕÕµõĥµĕõåąąµąÕĥÕ
0478/22/F/M/25 [Turn over
* 0000800000004 *
5 A program is written to only accept data that contains more than 9 characters. The program needs
to be tested. The table, when completed, shows appropriate test data that matches the type of test
data and the purpose of the test data.
AAABBBCCCD ......................................................................
AND Boundary
AAABBBCCC
......................................................................
[6]
(a) Identify the line numbers of five errors in the pseudocode and suggest a correction for each
error.
02
Error 1 line number ...................................................................................................................
DECLARE Highest : INTEGER
Correction .................................................................................................................................
...................................................................................................................................................
ĬÍĊ®Ġ´íÈõÏĪÅĊÝû¸Ā×
© UCLES 2025 ĬàĒôÛġďČ×ïýěĢĊ¾âùĂ
ĥąÅÕõõĥĕõÕÕąÅµåÕõÕ
0478/22/F/M/25
* 0000800000005 *
DO NOT WRITE IN THIS MARGIN
5
, ,
Correction .................................................................................................................................
...................................................................................................................................................
Correction .................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Correction .................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
[5]
(b) Write the pseudocode statement to output the average of the numbers, rounded to two
decimal places.
...................................................................................................................................................
............................................................................................................................................. [2]
(c) Explain how you could change the corrected algorithm so that it also finds the smallest
number that was input and outputs its value at the end.
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
............................................................................................................................................. [4]
ĬÏĊ®Ġ´íÈõÏĪÅĊÝù¸Ā×
© UCLES 2025 ĬàđóÓħēüâĉôζòĚâĉĂ
ĥąµĕµĕąõĥåąąÅÕÅĕĥÕ
0478/22/F/M/25 [Turn over
* 0000800000006 *
START
OUTPUT
"Continue?"
No IS Answer = Yes
'Y' ?
INPUT
STOP Value1
Yes IS Operator = No
'M' ?
OUTPUT OUTPUT
Value1 * Value1 /
DO NOT WRITE IN THIS MARGIN
Value2 Value2
ĬÑĊ®Ġ´íÈõÏĪÅĊàùµþ×
© UCLES 2025 ĬàĒóÐĝûòêþāçÖĊûĊùĂ
ĥÕĕĕµµąÕåÅåąąÕĥÕµÕ
0478/22/F/M/25
* 0000800000007 *
DO NOT WRITE IN THIS MARGIN
7
, ,
[5]
............................................................................................................................................. [1]
(c) There are problems with the given algorithm. If the lower-case letter ‘y’ is entered for Answer,
the algorithm stops and if a lower-case letter is entered for Operator, the algorithm gives an
incorrect output.
(i) Explain how you would change the algorithm to prevent the problems described.
DO NOT WRITE IN THIS MARGIN
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
DO NOT WRITE IN THIS MARGIN
(ii) Identify one more error related to inputs when the algorithm is run.
...........................................................................................................................................
..................................................................................................................................... [1]
ĬÓĊ®Ġ´íÈõÏĪÅĊàûµþ×
© UCLES 2025 ĬàđôØī÷ĂÏüðĢĂòßĊĉĂ
ĥÕĥÕõÕĥµµµõąąµąĕåÕ
0478/22/F/M/25 [Turn over
* 0000800000008 *
8 A database table, MajorCity, stores some details about a number of cities from around the
world.
(a) State the number of fields and records in this database table.
Fields ........................................................................................................................................
Records ....................................................................................................................................
[2]
DO NOT WRITE IN THIS MARGIN
ĬÑĊ®Ġ´íÈõÏĪÅĊÞùµĀ×
© UCLES 2025 ĬàđñØġąćìö÷ĩäÎýĚñĂ
ĥĥµÕµÕĥĕÕĕąąÅµåĕµÕ
0478/22/F/M/25
* 0000800000009 *
DO NOT WRITE IN THIS MARGIN
9
, ,
(b) Identify the field in the database table that is most suitable to be the primary key and give
one reason for your choice.
Reason .....................................................................................................................................
...................................................................................................................................................
[2]
(c) Give the output from the structured query language (SQL) statement:
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(d) Complete the SQL statement to list only the code, city, country and continent of all the cities
in the database table that are capital cities.
SELECT ....................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
............................................................................................................................................. [4]
DO NOT WRITE IN THIS MARGIN
ĬÓĊ®Ġ´íÈõÏĪÅĊÞûµĀ×
© UCLES 2025 ĬàĒòÐħĉ÷ÍĄĊàøæÙĚāĂ
ĥĥÅĕõµąõÅĥÕąÅÕÅÕåÕ
0478/22/F/M/25 [Turn over
* 0000800000010 *
B Z
[5]
(b) Complete the truth table from the given logic expression.
Working space
A B C Z
0 0 0
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
DO NOT WRITE IN THIS MARGIN
1 1 1
[4]
ĬÑĊ®Ġ´íÈõÏĪÅĊßù·þ×
© UCLES 2025 ĬàĔñÍģýđæíðÃÀÐĩâĉĂ
ĥµÕĕµÕÅĕõåąÅÅĕåĕąÕ
0478/22/F/M/25
DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
© UCLES 2025
,
* 0000800000011 *
ĥµåÕõµåõĥÕÕÅÅõÅÕĕÕ
ĬàēòÕĥāġÓċāĆĜèâùĂ
ĬÓĊ®Ġ´íÈõÏĪÅĊßû·þ×
,
11
0478/22/F/M/25
BLANK PAGE
[Turn over
* 0000800000012 *
10 A sports club uses a six-character alphanumeric membership code to identify each member of the
club.
The one-dimensional (1D) array MemberID[] is used to store the unique membership codes for
club members.
The two-dimensional (2D) array Name[] is used to store the names of the club members. The first
and last name of each member will be stored in separate array elements.
• Provide a menu that offers the choices: inputting a new member, outputting a list of
membership codes and first and last names, or stopping.
• Input and validate a response to the menu.
• When inputting a new member, input a new membership code and check that it contains six
characters:
○ If the new code is six characters, check it against all the previously stored membership
You must use pseudocode or program code and add comments to explain how your code works.
You do not need to declare any arrays, variables or constants; assume this has already been
done.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
ĬÑĊ®Ġ´íÈõÏĪÅĊÝù·Ā×
© UCLES 2025 ĬàēóÕğóĨèąĊýºČď²āĂ
ĥąõÕµµåÕąõåÅąõĥÕąÕ
0478/22/F/M/25
* 0000800000013 *
DO NOT WRITE IN THIS MARGIN
13
, ,
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
ĬÓĊ®Ġ´íÈõÏĪÅĊÝû·Ā×
© UCLES 2025 ĬàĔôÍĩïĘÑó÷ÌĞô˲ñĂ
ĥąąĕõÕŵĕąõÅąĕąĕĕÕ
0478/22/F/M/25 [Turn over
* 0000800000014 *
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
................................................................................................................................................... [15]
ĬÍĊ®Ġ´íÈõÏĪÅĊÞü¶Ă×
© UCLES 2025 ĬàēòÐħĄĠãõôħÂé¿ĂùĂ
ĥåąÕµµąĕõĕõąÅÕåÕÅÕ
0478/22/F/M/25
DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
© UCLES 2025
,
* 0000800000015 *
ĥåõĕõÕĥõĥĥåąÅµÅĕÕÕ
ĬàĔñØġĀĐÖăýâĖÑěĂĉĂ
ĬÏĊ®Ġ´íÈõÏĪÅĊÞú¶Ă×
,
15
0478/22/F/M/25
BLANK PAGE
* 0000800000016 *
BLANK PAGE
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
ĬÍĊ®Ġ´íÈõÏĪÅĊàü¶Ą×
© UCLES 2025 ĬàĔôØīîęáýĆé¸í¹ĒñĂ
ĥĕåĕµÕĥÕąÅÕąąµĥĕÅÕ
0478/22/F/M/25