Cambridge IGCSE: Computer Science 0478/23
Cambridge IGCSE: Computer Science 0478/23
com
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
www.dynamicpapers.com
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
www.dynamicpapers.com
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
www.dynamicpapers.com
13
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
© UCLES 2024 0478/23/M/J/24 [Turn over
www.dynamicpapers.com
14
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................. [15]
© UCLES 2024 0478/23/M/J/24
www.dynamicpapers.com
15
BLANK PAGE
BLANK PAGE
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.