Computer Science (2210) · Oct/Nov 2017 · PM 22
Cambridge Computer Science (2210) pm for paper 22, Oct/Nov 2017 — 2210/22/O/N/17, file 2210_w17_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 2017
PRE-RELEASE MATERIAL
* 2 0 1 9 5 2 0 9 7 9 *
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.
This document consists of 2 printed pages.
DC (LK) 150364
© UCLES 2017
[Turn over
2
In preparation for the examination candidates should attempt the following practical tasks by writing
and testing a program or programs.
The owner of a river boat hire company wants to calculate the daily profits from hiring out 10 rowing
boats on the river. Boats are numbered 1 to 10. Boats can be hired for use between 10:00 and 17:00
every day.
Write and test a program for the owner.
•
•
•
Your program must include appropriate prompts for the entry of data.
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.
TASK 1 – calculate the money taken in a day for one boat.
The cost of hiring a boat is $20 for one hour or $12 for half an hour. When a boat is hired the payment
is added to the money taken for the day. The running total of hours hired that day is updated and the
time when the boat must be returned is stored. At the end of the day the money taken and the total
hours hired is output.
No boat can be hired before 10:00 or returned after 17:00.
TASK 2 – find the next boat available.
Extend TASK 1 to work for all 10 rowing boats. Use the data stored for each boat to find out how many
boats are available for hire at the current time. If no boats are available show the earliest time that a
boat will be available for hire.
TASK 3 – calculate the money taken for all the boats at the end of the day.
At the end of the day use the data stored for each boat to calculate the total amount of money taken
and the total number of hours boats were hired that day. Find out how many boats were not used that
day and which boat was used the most. Provide a report for the owner to show this information.
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 2017
2210/22/PRE/O/N/17