2210 s19 QP 21
2210 s19 QP 21
Write your centre number, candidate number and name in the spaces at the top of this page.
Write in dark blue or black pen.
You may use an HB pencil for any diagrams, graphs or rough working.
Do not use staples, paper clips, glue or correction fluid.
DO NOT WRITE IN ANY BARCODES.
DO NOT ATTEMPT TASKS 1, 2 AND 3 in the pre-release material; these are for information only.
You are advised to spend no more than 40 minutes on Section A (Question 1).
No marks will be awarded for using brand names of software packages or hardware.
At the end of the examination, fasten all your work securely together.
The number of marks is given in brackets [ ] at the end of each question or part question.
DC (LEG) 180911
© UCLES 2019 [Turn over
2
Section A
You are advised to spend no longer than 40 minutes answering this section.
Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.
Pre-release material
The local high school uses buses to transport students to school. There are six bus routes labelled A to F. You have
conducted a survey to analyse the punctuality statistics of these buses over a four-week period. The data from the
survey are shown in the table:
Punctuality table
Day Bus A Bus B Bus C Bus D Bus E Bus F
Mon1 0 0 2 1 −1 0
Tue1 0 1 0 0 −1 −5
Wed1 0 0 −1 0 −1 −5
Thu1 2 0 −1 0 −2 −5
Fri1 2 1 −2 0 −4 −4
Mon2 4 2 −2 0 −10 −3
Tue2 0 0 −3 0 −2 −5
Wed2 3 0 −1 0 0 0
Thu2 4 0 0 0 0 0
Fri2 −2 0 0 0 0 0
Mon3 −5 1 −2 2 0 0
Tue3 0 0 0 0 1 −2
Wed3 0 0 1 0 2 −3
Thu3 3 0 1 0 −3 1
Fri3 4 2 1 0 1 1
Mon4 −1 0 1 0 1 1
Tue4 8 0 −1 0 3 0
Wed4 1 1 −1 0 −1 0
Thu4 1 0 2 0 0 −2
Fri4 −2 0 −2 0 0 −5
Positive numbers represent minutes early, negative numbers represent minutes late and 0 represents the bus having
been on time.
Write and test a program or programs for the local high school.
• Your program or programs must include appropriate prompts for the entry of data; data must be validated on
entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.
1 (a) All variables, constants and other identifiers must have meaningful names.
(i) State one array you used for Task 1. State the data type and purpose of this array.
Array ..................................................................................................................................
Purpose .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[3]
(ii) State one variable you used for Task 2 and one variable you used for Task 3. In each
case, state the data type and purpose of the variable.
Purpose .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Purpose .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[6]
(b) Write an algorithm to show how you calculated and output the number of late arrivals and the
average number of minutes late for each bus route (part of Task 2), using either pseudocode,
programming statements or a flowchart.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [6]
© UCLES 2019 2210/21/M/J/19 [Turn over
6
(c) Explain how your program uses the input in Task 3 to only find the data for that specific day
(part of Task 3). Any programming statements used in your answer must be fully explained.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(d) Explain how you would alter your program in Task 1 to allow you to choose the number of
weeks to enter data on bus arrival times.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Section B
2 Describe each of the following data types used in programming. In each case, give an example of
a piece of data to illustrate your answer. Each example must be different.
Char
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
String
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Boolean
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[6]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
............................................................................................................................................. [1]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(c) Complete the trace table for this program code using the test data: 200, 300, –1, 50, 60
Value OUTPUT
[3]
[5]
© UCLES 2019 2210/21/M/J/19 [Turn over
12
5 The table, BEVERAGES, shows the number of calories in 100 ml of a range of popular beverages.
It also shows the availability of these drinks in a can, a small bottle and a large bottle.
(a) Give a reason for choosing BevNo as the primary key for this table.
...................................................................................................................................................
............................................................................................................................................. [1]
............................................................................................................................................. [1]
Sort: Descending
Show: ü ü
Criteria: = "Yes" = "Yes" = "Yes"
or:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(d) Complete the query-by-example grid to output a list showing just the names and primary keys
of all the beverages with a calorie count greater than 45. The list should be in alphabetical
order of names.
Field:
Table:
Sort:
Show:
Criteria:
or:
[4]
BLANK PAGE
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 the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.