Cambridge O Level: Computer Science 2210/21
Cambridge O Level: Computer Science 2210/21
Cambridge O Level: Computer Science 2210/21
* 0 2 5 8 8 6 9 4 2 4 *
1 hour 45 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (DE) 326841
© UCLES 2023 [Turn over
2
1 (a) Four descriptions of stages in the program development life cycle are shown.
Draw one line to link each description to its most appropriate program development life cycle
stage.
Program development life cycle description Program development life cycle stage
coding
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
[3]
2 Tick (ü) one box to show the name of the data structure used to store a collection of data of the
same data type.
A Array
B Constant
C Function
D Variable
[1]
© UCLES 2023 2210/21/M/J/23
3
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) A validation check is used to make sure that any value that is input is an integer between 30
and 200 inclusive.
Give one example of each type of test data to check that the validation check is working as
intended. Each example of test data must be different.
Reason .....................................................................................................................................
...................................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
[6]
DIV ...................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
ROUND ..............................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
[4]
© UCLES 2023 2210/21/M/J/23 [Turn over
4
5 An algorithm has been written in pseudocode to allow some numbers to be input. All the positive
numbers that are input are totalled and this total is output at the end.
An input of 0 stops the algorithm.
01 Exit 1←
02 WHILE Exit <> 0 DO
03 INPUT Number
04 IF Number < 0
05 THEN
06 Total ←
Total + Number
07 ELSE
08 IF Number = 0
09 THEN
10 Exit 1 ←
11 ENDIF
12 ENDIF
13 ENDIF
14 OUTPUT "The total value of your numbers is ", Number
(a) Identify the four errors in the pseudocode and suggest a correction for each error.
Error 1 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Error 2 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Error 3 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Error 4 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
[4]
(b) Describe how you could change the corrected algorithm to record and output how many
positive numbers have been included in the final total.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
1 .......................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
2 .......................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
[4]
START
Pointer 1
INPUT
Letter
IS No
Word[Pointer, 1] Pointer Pointer + 1
= Letter ?
Yes
INPUT Choice
Yes IS No
Choice = STOP
'Y' ?
The table represents the two-dimensional (2D) array Word[] which stores the first half of the
phonetic alphabet used for radio transmission. For example, Word[10,1] is ‘J’.
Index 1 2
1 A Alpha
2 B Bravo
3 C Charlie
4 D Delta
5 E Echo
6 F Foxtrot
7 G Golf
8 H Hotel
9 I India
10 J Juliet
11 K Kilo
12 L Lima
13 M Mike
(a) Complete the trace table for the algorithm by using the input data: F, Y, D, N
[4]
...................................................................................................................................................
............................................................................................................................................. [1]
(c) Describe one problem that could occur with this algorithm if an invalid character was input.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
BLANK PAGE
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
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 TVRange shows the main features and prices of a range of televisions.
(a) 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.
(c) Complete the structured query language (SQL) query to return the television (TV) code,
screen size and price of all Smart TVs in the database table.
....................................................... TVRange
11 A one-dimensional (1D) array Days[] contains the names of the days of the week. A
two-dimensional (2D) array Readings[] is used to store 24 temperature readings, taken once
an hour, for each of the seven days of the week. A 1D array AverageTemp[] is used to store the
average temperature for each day of the week.
The position of any day’s data is the same in all three arrays. For example, if Wednesday is
in index 4 of Days[], Wednesday’s temperature readings are in index 4 of Readings[] and
Wednesday’s average temperature is in index 4 of AverageTemp[]
The temperature readings are in Celsius to one decimal place. Temperatures can only be from
–20.0 °C to +50.0 °C inclusive.
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.
You will need to initialise and populate the array Days[] at the start of the program.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
© UCLES 2023 2210/21/M/J/23
15
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
© UCLES 2023 2210/21/M/J/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.