Computer Science (2210) · Oct/Nov 2018 · PM 22
Cambridge Computer Science (2210) pm for paper 22, Oct/Nov 2018 — 2210/22/O/N/18, file 2210_w18_pm_22.pdf.
Text of this paper
Cambridge International Examinations
Cambridge Ordinary Level
2210/22
COMPUTER SCIENCE
Paper 2 Problem-solving and Programming
October/November 2018
PRE-RELEASE MATERIAL
* 4 6 8 1 3 3 5 0 7 8 *
No Additional Materials are required.
This material should be given to the relevant teachers and candidates as soon as it has been received
at the Centre.
READ THESE INSTRUCTIONS FIRST
Candidates should use this material in preparation for the examination. Candidates should attempt the
practical programming tasks using their chosen high-level, procedural programming language.
Any businesses described in this paper are entirely fictitious.
This document consists of 2 printed pages.
DC (SC) 173733
© UCLES 2018
[Turn over
2
In preparation for the examination candidates should attempt the following practical tasks by writing
and testing a program or programs.
A junior park run event is held every week on a Saturday morning in a local park over a distance of two
kilometres. Children between the ages of 4 and 14 inclusive can register to take part. Children register
with their name and age. When they register, they are allocated a unique identification number of four
digits; the last digit is a check digit. Once registered a child can take part in junior park run events for a
year.
For each event, the organisers record the time each child takes to run two kilometres. Their time is
stored for every event they complete and the number of runs they have completed is updated by one.
If their time is faster than their personal best (PB) time, their PB time is updated. When a child has
completed 11 runs, they are awarded a half-marathon wristband. When a child has completed 22 runs,
they are awarded a full-marathon wristband.
A program is required to update the children’s data, update PB times if necessary, and decide if a
wristband is to be awarded. The program also needs to identify the fastest child at this event for each
of the age ranges: 4 to 6, 7 to 10 and 11 to 14.
Write and test a program or programs for the park run organiser.
•
•
•
Your program or programs must include appropriate prompts for the entry of data.
Error messages and other output need to be set out clearly and be understandable.
All variables, arrays, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.
TASK 1 – Registering to take part.
Write a program to set up arrays to store the data for 20 children. On registration, each child must
be allocated a unique identification number of four digits; the last digit is a check digit. The unique
identification number, age in years and name for each child is recorded and stored on registration. The
PB time and the number of runs are initialised to zero and these values stored on registration. Their PB
time is stored as minutes correct to two decimal places.
TASK 2 – Recording the times.
Extend your program to record the unique identification number and to input the start time and finish
time for every child completing the junior park run event. Calculate and store the time each child took
to complete the run. A registered child does not have to compete in each event. Only one time per child
is recorded during an event.
TASK 3 – Updating the children’s data and identifying the fastest child for each age range.
Extend your program to update the number of runs and the PB time if necessary for every child
completing the junior park run event. Check if any half- or full-marathon wristbands need to be awarded.
Output the names and the type of wristbands. Output the names and the times of the fastest child at
this event for each of the age ranges 4 to 6, 7 to 10 and 11 to 14.
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 International
Examinations Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cie.org.uk after
the live examination series.
Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local
Examinations Syndicate (UCLES), which is itself a department of the University of Cambridge.
© UCLES 2018
2210/22/PRE/O/N/18