Computer Paper 2
Computer Paper 2
* 6 3 7 7 6 2 5 9 4 8 *
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 (PQ/CT) 329143/3
© UCLES 2024 [Turn over
2
A validation check to make sure that an email address contains an ‘@’ sign is a
A range check.
B visual check.
C presence check.
D format check.
[1]
2 Four descriptions of programming concepts and five programming concepts are shown.
(a) Draw one line to link each description to the most appropriate programming concept.
function
a subroutine that may not return a value
procedure
a value that is declared and used within a
specific procedure
parameter
a value that a procedure expects you to
supply when it is called
global variable
[4]
(b) Write the pseudocode to use a procedure named Average that passes the values 25 and 50
to the procedure.
...................................................................................................................................................
............................................................................................................................................. [2]
(c) Outline the role of procedures and functions in creating a program that is easier to maintain.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
Integer ..............................................................................................................................................
..........................................................................................................................................................
Example ...........................................................................................................................................
Real ..................................................................................................................................................
..........................................................................................................................................................
Example ...........................................................................................................................................
[4]
4 This pseudocode algorithm is intended to allow, at random, between 1 and 20 values to be entered
and totalled. The total and average of the entered values are output at the end of the algorithm.
(a) Identify the line numbers of four errors in the pseudocode and suggest corrections.
Correction .................................................................................................................................
...................................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
[4]
(b) Write the pseudocode statement that would output the average calculated in line 13 of the
algorithm rounded to one decimal place.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(c) Explain how you should alter the original corrected algorithm to make sure that all the
numbers entered are between 1 and 500 inclusive. If any numbers fall outside these limits, a
replacement value is requested and entered.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................... [5]
START
INPUT
Numbers[Count]
STOP
Count Count + 1
No IS Count >
Limit?
IS Numbers[Count] > No
Yes
Numbers[Count + 1]?
Flag TRUE
Yes
Swap Numbers[Count]
IS Flag = No
TRUE?
Numbers[Count] Numbers[Count + 1]
Yes
Flag True
Count Count + 1
Numbers
Limit Count [1] [2] [3] [4] [5] [6] [7] Flag Swap Result OUTPUT
[7]
© UCLES 2024 0478/21/M/J/24 [Turn over
8
(b) Outline the processes involved in the algorithm shown in the flowchart on page 6.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
S Z
[5]
(b) Complete the truth table from the given logic expression.
Working space
R S T Z
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]
9 A database table called SoftDrinks stores details of the soft drinks sold by a small shop.
Name Cola
Container Can
SizeCl 330
NumberInStock 30
ReorderLevel 15
Reordered Yes
(a) State whether any of the given fields would be suitable as a primary key and give a reason for
your answer.
...................................................................................................................................................
............................................................................................................................................. [1]
(b) Complete the structured query language (SQL) statement to return the number of cans the
shop has in stock.
FROM .......................................................
10 The one-dimensional (1D) array Clubs[] is used to store the names of 12 cricket clubs in a local
sports league.
The two-dimensional (2D) array Statistics[] is used to store, for each cricket club, the number
of:
• matches won
• matches drawn
• matches lost.
The 1D array Points[] is used to store the total number of points each cricket club has been
awarded.
The position of any cricket club’s data is the same in all three arrays. For example, the data in
index 2 of Statistics[] and index 2 of Points[] belongs to the cricket club in index 2 of
Clubs[]
The variable Matches stores the number of matches played by each team. Each team plays the
same number of matches.
You must use pseudocode or program code and add comments to explain how your code works.
You do not need to declare any arrays or variables; you may assume that this has already been
done.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
© UCLES 2024 0478/21/M/J/24 [Turn over
14
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................. [15]
© UCLES 2024 0478/21/M/J/24
* 0019655533401 *
, ,
Cambridge IGCSE™
¬O. 3mKo[U¢8¦6W
¬`I£0£]v§¦Lb:V
¥U 5¥5U5¥ Eu5U
* 4 5 6 7 6 0 4 2 2 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 (LK/CB) 329121/3
© UCLES 2024 [Turn over
* 0019655533402 *
1 Tick (✓) one box to identify a method used to design and construct a solution to a computing
problem.
A analysis
B coding
C flowchart
D testing
[1]
Draw one line to link each logic function to its standard symbol. Not all standard symbols will be
used.
AND
NAND
OR
3 Identify three different tasks in the analysis stage of the program development life cycle.
1 .......................................................................................................................................................
..........................................................................................................................................................
2 .......................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
..........................................................................................................................................................
3 .......................................................................................................................................................
..........................................................................................................................................................
[3]
ĬÍĊ®Ġ³íËïÛđÕ̵Ĩ¸Ď×
© UCLES 2024 ĬėěßÌħ¼ąÖċôČβĒĂÎĂ
ĥąĕĕõõåÕĥÕĥåąÅåµĕÕ
0478/22/M/J/24
* 0019655533403 *
DO NOT WRITE IN THIS MARGIN
3
, ,
4 A program needs to make sure the characters input for a product code meet these rules:
(a) Identify three validation checks and state how each check would make sure the product code
met one of these rules.
Check 1 ....................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
Check 2 ....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Check 3 ....................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
[6]
(b) The program design will include a pseudocode algorithm. Assume that the product code is
stored in the variable Product
(i) Write the pseudocode to make sure that the product code is six characters in length.
...........................................................................................................................................
...........................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Write the pseudocode to make sure that the first two characters of the product code are
“PD”.
...........................................................................................................................................
...........................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
ĬÏĊ®Ġ³íËïÛđÕ̵Ħ¸Ď×
© UCLES 2024 ĬėĜàÄġ¸õãíý½ĊÊÆĂÞĂ
ĥąĥÕµĕŵõåµåąåÅõąÕ
0478/22/M/J/24 [Turn over
* 0019655533404 *
5 A high-level programming language makes use of arithmetic, Boolean and logical operators.
Arithmetic .........................................................................................................................................
..........................................................................................................................................................
Example ...........................................................................................................................................
Boolean ............................................................................................................................................
..........................................................................................................................................................
Example ............................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
Example ...........................................................................................................................................
..........................................................................................................................................................
[6]
ĬÍĊ®Ġ³íËïÛđÕĢ·Ĩ¸Đ×
© UCLES 2024 ĬėĜÝÄīÆôØóĆÆìĦĨĒÖĂ
ĥµµÕõĕÅĕĕąÅåÅåĥõĕÕ
0478/22/M/J/24
* 0019655533405 *
DO NOT WRITE IN THIS MARGIN
5
, ,
Numbers are input. The number 9999.9 is the last number to be input and is ignored.
(a) Write an algorithm in pseudocode to total the numbers input and to output the total.
You do not need to validate the input.
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
............................................................................................................................................. [4]
(b) Write an algorithm in pseudocode to count and output the number of input values that are
greater than 100. You do not need to validate the input.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
DO NOT WRITE IN THIS MARGIN
ĬÏĊ®Ġ³íËïÛđÕĢ·Ħ¸Đ×
© UCLES 2024 ĬėěÞÌĝÊĄáąûăðĎ´ĒæĂ
ĥµÅĕµõåõąõĕåÅÅąµąÕ
0478/22/M/J/24 [Turn over
* 0019655533406 *
7 An algorithm has been written in pseudocode to find and display the maximum and minimum
values in an array of 1000 positive numbers. The array List[] starts at index 1
01 Max List[1]
02 Min List[1]
03 FOR Counter 2 TO 1000
04 IF List[Counter] < Max
05 THEN
06 Max List[Counter]
07 ENDIF
08 IF List[Count] ˂ Min
(b) Identify the line numbers of the three errors in the pseudocode and suggest a correction for
each error.
Correction .................................................................................................................................
...................................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
[3]
DO NOT WRITE IN THIS MARGIN
ĬÑĊ®Ġ³íËïÛđÕ̶ĦµĎ×
© UCLES 2024 ĬėĜÞÇħâĊéĂĊúĐĦѺÖĂ
ĥĥĥĕµÕåÕÅĕµåąÅåõÕÕ
0478/22/M/J/24
* 0019655533407 *
DO NOT WRITE IN THIS MARGIN
7
, ,
8 A logic circuit is to be built to control the opening of a safe used to store money. There are two
keys, A and B, and a time switch C. The safe can only open if both keys are used and the time
switch is off.
not used 0
key A
used 1
not used 0
key B
DO NOT WRITE IN THIS MARGIN
used 1
switch off 0
time switch C
switch on 1
............................................................................................................................................. [3]
DO NOT WRITE IN THIS MARGIN
Working space
A B C X
0 0 0
0 0 1
DO NOT WRITE IN THIS MARGIN
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 2024 ĬėěÝ¿ġÞúÐø÷¯ÌĎąºæĂ
ĥĥĕÕõµÅµÕĥĥåąåŵÅÕ
0478/22/M/J/24 [Turn over
* 0019655533408 *
START
A FALSE
B 1
Yes
List[B] List[B + 1]
List[B + 1] T
A TRUE
No IS B =
5?
Yes
Yes IS A =
TRUE?
STOP
(a) The array List[1:5] used in the flowchart contains this data:
15 17 20 5 9
DO NOT WRITE IN THIS MARGIN
ĬÑĊ®Ġ³íËïÛđÕ̏ĦµĐ×
© UCLES 2024 Ĭėěà¿īÐïëúð¸Ī²çêÎĂ
ĥÕÅÕµµÅĕµÅĕåÅåĥµÕÕ
0478/22/M/J/24
* 0019655533509 *
DO NOT WRITE IN THIS MARGIN
9
, ,
Complete the trace table using the data given in the array.
[5]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
ĬÓĉ¯Ġ³íËïÛđÕĢ·ĦµĐ×
© UCLES 2024 ĬėěÞÄĨßęÜûĄăÑòçĚæĂ
ĥĥĥĕµĕĥõÕŵåąĥĥõĥÕ
0478/22/M/J/24 [Turn over
* 0019655533510 *
10 A television subscription service has a new database table named Contract to store details of
their subscribers’ contracts. The table contains these fields:
............................................................................................................................................. [1]
(b) Complete the table to identify the most appropriate data type for these fields in Contract
ContractNumber
Months
Sport
[2]
(c) Explain the purpose of these structured query language (SQL) statements.
...................................................................................................................................................
...................................................................................................................................................
Statement 2 ..............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
DO NOT WRITE IN THIS MARGIN
ĬÑĉ¯Ġ³íËïÛđÕ̶Ĩ·Ď×
© UCLES 2024 ĬėęÝÁĤëïãĆöĠĩČėâÞĂ
ĥµõĕõõåĕĥąĥĥąåąµÅÕ
0478/22/M/J/24
* 0019655533511 *
DO NOT WRITE IN THIS MARGIN
11
, ,
(d) Complete this SQL statement to find the contract numbers of the subscribers that take both
the news and sports services.
SELECT .....................................................................................................................................
FROM Contract
ĬÓĉ¯Ġ³íËïÛđÕ̶Ħ·Ď×
© UCLES 2024 ĬėĚÞÉĦçÿÖôċéôÃâÎĂ
ĥµąÕµĕÅõõõµĥąÅĥõÕÕ
0478/22/M/J/24 [Turn over
* 0019655533512 *
11 A one-player game uses the two-dimensional (2D) array Grid[] to store the location of a secret
cell to be found by the player in 10 moves. Each row and column has 5 cells.
Start
Grid[1,1]
• The program places an ‘X’ in a random cell (not in Grid[1,1]) and empties all the other
cells in the grid.
• The player starts at the top left of the grid.
• The player has 10 moves.
You must use pseudocode or program code and add comments to explain how your code works.
You do not need to declare any arrays or variables; you may assume that this has already been
done.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
ĬÑĉ¯Ġ³íËïÛđÕ̏Ĩ·Đ×
© UCLES 2024 ĬėĚßÉĠÕĊáîĄâďÐġ²æĂ
ĥąÕÕõĕÅÕĕÕÅĥÅÅÅõÅÕ
0478/22/M/J/24
* 0019655533513 *
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 2024 ĬėęàÁĪÙúØČíħËèµ²ÖĂ
ĥąåĕµõåµąåĕĥÅååµÕÕ
0478/22/M/J/24 [Turn over
* 0019655533514 *
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................. [15]
ĬÍĉ¯Ġ³íËïÛđÕĢ·ĥ¶Ē×
© UCLES 2024 ĬėĚÞÄĨæĂæþúÌħí±ĂÎĂ
ĥååÕõĕĥĕĥµĕåąĥąõąÕ
0478/22/M/J/24
Cambridge IGCSE™
* 5 2 9 6 2 2 3 7 5 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 (CE/CB) 329120/3
© UCLES 2024 [Turn over
2
A represents a subroutine.
B represents a decision.
C represents an input/output.
D represents a terminator.
[1]
2 (a) Four logic gate symbols and five logic functions are shown.
Draw one line to link each logic gate symbol to the appropriate logic function.
AND
XOR
NOT
NAND
OR
[4]
Working space
A B C Z
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]
3 Describe the characteristics of the string and char data types and give an example of each.
String ................................................................................................................................................
..........................................................................................................................................................
Example ...........................................................................................................................................
Char .................................................................................................................................................
..........................................................................................................................................................
Example ...........................................................................................................................................
[4]
4 This pseudocode algorithm is intended to allow data for up to 50 people to be entered and stored
in a two-dimensional (2D) array. The data is their last name, first name and the city in which they
live.
(a) Identify the line numbers of the four errors in the pseudocode and suggest corrections.
Correction .................................................................................................................................
...................................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
[4]
© UCLES 2024 0478/23/M/J/24
5
(b) Write the pseudocode that you could add to the end of this algorithm to output the contents of
the array. Make sure that the output ends when the data in the array ends.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(c) Explain how you could alter the original corrected algorithm to make sure that the
number of elements being added to the array does not exceed the maximum size of the
array (50 elements).
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
START
L 0
S 10000
T 0
A 0
INPUT
Limit
Count 1
INPUT
Value
IS IS
No No
Value < S Value > L
? ?
Yes Yes
S Value L Value
T T + Value
IS
No
Count > Count Count + 1
Limit ?
Yes
A T / Limit
STOP
[6]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(c) Explain why the identifiers L, S, T and A may not be appropriate to use as identifiers and how
they could be improved.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(d) State a more appropriate identifier for each of the variables L, S, T and A
A
[2]
6 A program is to be written that will accept integers that are between the values of 1 and 80
inclusive.
(a) Give examples of normal, abnormal and extreme test data that could be used to make sure
the program only accepts valid data.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
• store the content of the variable you created in part (a) to a text file named
"Subjects.txt"
• close the text file at the end of the algorithm.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
8 A database table called Hangar1 stores details of a collection of historic aircraft at a museum.
(a) State the number of fields and records in the database table.
Fields ........................................................................................................................................
Records ....................................................................................................................................
[2]
(b) Give the output that would be produced by the structured query language (SQL) statement:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(c) Complete the SQL statement to display only the ID and model of all the aircraft that are
airworthy.
...................................................................................................................................................
...................................................................................................................................................
................................................................................................................................................ ;
[4]
9 A one-dimensional (1D) array Teams[] contains the names of 10 football teams in a local league.
A two-dimensional (2D) array Results[] stores, for each team, the total number of:
• games won
• games drawn
• games lost
• points.
The position of any team’s data is the same in both arrays. For example the data in index 3 of
Results[] belongs to the team in index 3 of Teams[]
The array data will be used to find the current leader of the league.
The variable Played stores the number of games played by each team. Each team plays the
same number of games.
• allows the number of games played to be input and stored, with a maximum of 18 games
• allows the names of the teams to be input and stored
• allows the number of games won, drawn and lost to be input and stored for each team
• validates the number of games played and the number of games won, drawn or lost against
the number of games played
• calculates and stores the number of points for each team using three points for a win and one
point for a draw; there are no points for a loss
• sorts the array Results[] into descending order of number of points, ensuring the
corresponding parallel array Teams[] is kept in the same order
• determines how many teams have the highest number of points
• outputs the name(s) of the winning team(s) along with the number of points achieved.
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; you may assume that this has
already been done.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
© UCLES 2024 0478/23/M/J/24
13
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
© UCLES 2024 0478/23/M/J/24 [Turn over
14
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................. [15]
© UCLES 2024 0478/23/M/J/24
Cambridge IGCSE™
* 5 6 2 6 6 1 3 3 2 9 *
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 (LK/SG) 314037/5
© UCLES 2023 [Turn over
2
1 Tick (3) one box to show which operator means less than or equal to.
A OR
B <
C <=
D >=
[1]
2 Tick (3) one box to show how a value can be passed to a procedure.
A function
B parameter
C return
D subroutine
[1]
Draw one line to link each description to the most appropriate data type.
Not all data types will be used.
BOOLEAN
a whole number
CHAR
a single letter
INTEGER
a word or phrase
REAL
[4]
4 Circle the three words representing places where data may be stored.
5 The first stage of the program development life cycle is analysis. Two of the tasks in analysis are
abstraction and decomposition.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Identify three of the component parts when a problem has been decomposed at the analysis
stage.
1 ................................................................................................................................................
2 ................................................................................................................................................
3 ................................................................................................................................................
[3]
(c) Identify and describe one other stage of the program development life cycle.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
............................................................................................................................................. [1]
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
4 ................................................................................................................................................
...................................................................................................................................................
[4]
The array:
A ................................................................................................................................................
The variables:
T ................................................................................................................................................
C ................................................................................................................................................
L ................................................................................................................................................
[3]
(d) State two other ways the algorithm can be made easier to understand and maintain.
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
[2]
B X
(a) Write a logic expression for this logic circuit. Do not attempt to simplify this logic expression.
X = ............................................................................................................................................
...................................................................................................................................................
[4]
(b) Complete the truth table from the given logic circuit.
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]
............................................................................................................................................. [1]
START
STOP
[6]
© UCLES 2023 0478/21/O/N/23
9
(c) Give two different sets of test data for this algorithm and state the purpose of each set.
Set 1 .........................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Set 2 .........................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[4]
(d) Complete the headings for the trace table to show a dry-run for this algorithm.
You do not need to trace the algorithm.
[3]
(e) Describe an improvement that should be made to the requirements for this algorithm.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
9 A model shop wants to set up a database to help with stock control of the model figures available
for sale. The shop wants to store this information about the model figures:
Field 1 – catalogue number, for example MD1234
Field 2 – description, for example ‘small white dog’
Field 3 – number in stock, for example 5
Field 4 – the price of each model, for example 7.40
Field 5 – if the model has already been painted, yes or no.
(b) (i) Give the name of the field that should be used for the primary key.
..................................................................................................................................... [1]
..................................................................................................................................... [1]
(c) Structured query language (SQL) is used to query data stored in this database.
State what these SQL commands are used for.
SELECT .....................................................................................................................................
...................................................................................................................................................
FROM .........................................................................................................................................
...................................................................................................................................................
WHERE .......................................................................................................................................
...................................................................................................................................................
[3]
10 Drama students put on a performance of a play for one evening. Seats in a small theatre can be
booked for this performance.
The theatre has 10 rows of 20 seats. The status of the seat bookings for the evening is held in the
two-dimensional (2D) Boolean array Evening[]
Each element contains FALSE if the seat is available and TRUE if the seat is booked.
Up to and including four seats can be booked at one time. Seats are allocated in order from those
available. A row or seat number cannot be requested.
The array Evening[] has already been set up and some data stored.
You must use pseudocode or program code and add comments to explain how your code works.
You do not need to declare any arrays or variables; you may assume that this has already been
done.
You do not need to initialise the data in the array Evening[]
All inputs and outputs must contain suitable messages.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
© UCLES 2023 0478/21/O/N/23 [Turn over
14
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................. [15]
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 (RW/SG) 314039/4
© UCLES 2023 [Turn over
2
B is an integer.
C is correct.
D is not a string.
[1]
2 A type of validation check is a length check. Another type of validation check is used to make sure
that any date entered is in the dd/mm/yyyy style:
dd means day, mm means month and yyyy means year.
............................................................................................................................................. [1]
(b) Give one example of normal test data and one example of abnormal test data you should
use to make sure the check in part (a) is working properly.
Normal ......................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
Abnormal ..................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
[4]
(c) Describe how a length check could be used with the date entered.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(a) Draw one line to link each pseudocode statement to the most appropriate pseudocode use.
finding an average
Value (A1 + A2 + A3) / 3
totalling
Loop1 Loop1 + 1
using a conditional statement
Write a pseudocode algorithm using a single loop to find the lowest value in this array and
output the result only once.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
© UCLES 2023 0478/22/O/N/23 [Turn over
4
4 An algorithm has been written in pseudocode to allow the names of 50 cities and their countries to
be entered and stored in a two‑dimensional (2D) array. The contents of the array are then output.
(a) Identify the four errors in the pseudocode and suggest corrections.
Error 1 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Error 2 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Error 3 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Error 4 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
[4]
(b) Describe the changes you should make to the corrected algorithm to allow the name of a
country to be input and to display only the stored cities from that country.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [5]
5 Explain how variables and constants should be used when creating and running a program.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................... [3]
6 The flowchart represents an algorithm that performs a process on groups of values that are input.
The algorithm will fail if the first value of any group is 0.
START
Total 0
OUTPUT
"Average is ",
Average
Count 0
INPUT OUTPUT
Value "Total is ",
Total
IS Yes
Value = Average Total / Count
0 ?
No
IS Yes
Value = STOP
–1 ?
No
Count Count + 1
[5]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
7 The string operation SUBSTRING(Quote, Start, Number) returns a string from Quote
beginning at position Start that is Number characters long. The first character in Quote is in
position 1.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................... [5]
8 Explain why a programmer would use procedures and parameters when writing a program.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................... [4]
B Z
[4]
(b) Complete the truth table from the given logic expression.
Working space
A B C Z
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]
10 A database table called Horses stores details about the horses kept at a horse sanctuary.
............................................................................................................................................. [1]
(b) Give the name of the field that is most suitable to be the primary key.
Field ..........................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
[2]
Complete the table to show the most appropriate data type for each field.
Each data type must be different.
Gender
Age
Arrived
[2]
(d) Complete the structured query language (SQL) to return the code and breed of all the horses
whose breed originated in Scotland.
FROM .........................................
11 A wood flooring company stores the names of up to 100 customers in a one‑dimensional (1D) array
Customers[]. A two‑dimensional (2D) array Quotations[] stores details of each customer’s
quotation:
• length of room (one decimal place)
• width of room (one decimal place)
• area of wood required (rounded up to next whole number)
• choice of wood index (whole number)
• price of wood required in dollars (two decimal places).
The floor measurements (room length and room width) are taken in metres. All floors are rectangles
and room measurements must be between 1.5 and 10.0 inclusive.
The index of any customer’s data is the same in both arrays. For example, a customer named in
index 4 of Customers[] corresponds to the data in index 4 of Quotations[]
The data are stored in two 1D arrays named WoodType[] and Price[]. The index of the wood
type and price in their arrays share the same index number.
You must use pseudocode or program code and add comments to explain how your code works.
You do not need to declare any arrays or variables; you may assume that this has already been
done.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
© UCLES 2023 0478/22/O/N/23
13
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
© UCLES 2023 0478/22/O/N/23 [Turn over
14
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................. [15]
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 (CJ/CT) 313523/5
© UCLES 2023 [Turn over
2
1 Tick (3) one box to show which term is an example of a verification check.
B Format check
C Length check
D Presence check
[1]
2 Tick (3) one box to show which library routine returns the remainder of a division.
A DIV
B MOD
C RANDOM
D ROUND
[1]
3 (a) Four pseudocode descriptions and five pseudocode keywords are shown.
Draw one line to link each pseudocode description to the most appropriate pseudocode
keyword. Not all pseudocode keywords will be used.
WRITE
retrieves data from a file
READ
[4]
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
[2]
(a) Give the names of two validation checks that are required for this program.
1 ................................................................................................................................................
2 ................................................................................................................................................
[2]
(b) Complete this pseudocode to perform your two validation checks, using your answers given
in (a):
OUTPUT "Please enter the number of seats you want to book "
INPUT Seats
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[5]
(c) Give one item of test data to use when testing this program.
State the reason for your choice of test data.
...................................................................................................................................................
[2]
5 An algorithm has been written in pseudocode to check if a new password is in a list of previously
used passwords OldList[]
If the password is not found, the new password will be stored at the end of the list to replace
"XXXX" already stored there.
(a) Identify the three errors in the pseudocode and suggest corrections.
Error 1 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Error 2 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Error 3 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
[3]
START
STOP
[6]
6 There are three descriptions of logic gates. Each logic gate has two inputs A and B with one
output X.
Identify each logic gate.
Complete a truth table for each logic gate.
(a) The only time the output is 1 is when both inputs are 1.
A B X
Logic gate ...............................................
0 0
Complete the truth table for this description.
0 1
1 0
1 1
[2]
1 0
1 1
[2]
(c) The only time the output is 1 is when both inputs are 0.
A B X
Logic gate ...............................................
0 0
Complete the truth table for this description.
0 1
1 0
1 1
[2]
Draw a logic circuit for this logic expression. Each logic gate must have a maximum of two
inputs. Do not attempt to simplify this logic expression.
B X
[5]
Difference 1 ......................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
Difference 2 ......................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
[4]
START
Accept 0
Reject 0
INPUT PartOK
No
IS PartOK Reject Reject + 1
= 'Y'?
Yes
Accept Accept + 1
No IS Accept
= 10 ?
Yes
Yes
IS Reject Error Reject/Accept * 100
> 1?
No
OUTPUT
"Too many rejected ",
OUTPUT Error, "% error"
"Success"
STOP
[5]
(b) Describe how the algorithm should be changed to accept ‘Y’ or ‘y’ for a successfully
manufactured part.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
9 A sanctuary for pheasants has set up a new database table called PheasantList to store details
of the different species of bird at the sanctuary. Part of this table is given, showing: species,
description, number of birds at the sanctuary, if the birds are breeding or not, and number of
young born this year.
(a) State the number of records and fields in this part of the database table.
Records .....................................................................................................................................
Fields .........................................................................................................................................
[2]
(b) (i) Give the name of a field that could be used for the primary key.
..................................................................................................................................... [1]
(ii) Explain why the sanctuary might decide not to use the field in (b)(i) as the primary key.
...........................................................................................................................................
..................................................................................................................................... [1]
...........................................................................................................................................
..................................................................................................................................... [1]
(c) Write the output that would be given by this structured query language (SQL) statement:
FROM PheasantList
...................................................................................................................................................
............................................................................................................................................. [2]
(d) Complete this SQL statement to display all the species of pheasant where the birds are
breeding and there were no young born this year:
SELECT ....................................................................................................................................
FROM ........................................................................................................................................
WHERE ......................................................................................................................................
.............................................................................................................................................. ;
[4]
10 A weather station takes temperature readings once an hour for a week. These temperatures are
stored in a two-dimensional (2D) array Temperatures[]
Each column contains 24 readings for a single day. The first temperature is recorded at 00:00 and
the final temperature at 23:00. There are seven columns, one for each day of the week, starting
with Monday and ending with Sunday.
The variables MaxDay, MinDay and AvDay are used to store the maximum, minimum, and
average temperatures for a day. The variables MaxWeek, MinWeek and AvWeek are used to store
the maximum, minimum, and average temperatures for the week.
The array has already been set up and the data stored.
You must use pseudocode or program code and add comments to explain how your code works.
All inputs and outputs must contain suitable messages.
You do not need to declare any arrays or variables; you may assume that this has already been
done.
You do not need to initialise the data in the array Temperatures[]
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
© UCLES 2023 0478/23/O/N/23
15
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
© UCLES 2023 0478/23/O/N/23 [Turn over
16
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................. [15]
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.