Computer Science (2210) · May/June 2020 · PM 22

Cambridge Computer Science (2210) pm for paper 22, May/June 2020 — 2210/22/M/J/20, file 2210_s20_pm_22.pdf.

Advertisement
Loading the paper…

More Computer Science (2210) papers

Other papers · May/June 2020

Paper 22 in other years

All Computer Science papers
Text of this paper

Cambridge O Level
COMPUTER SCIENCE

2210/22

Paper 2 Problem-solving and Programming

May/June 2020

PRE-RELEASE MATERIAL
* 9 1 2 4 6 4 7 6 0 5 *

No additional materials are needed.
This material should be given to the relevant teachers and candidates as soon as it has been
received at the centre.
INSTRUCTIONS
●
You should use this material in preparation for the examination.
●
You should attempt the practical programming tasks using your chosen high-level, procedural
programming language.

This document has 2 pages. Blank pages are indicated.
DC (RW) 198773
© UCLES 2020

[Turn over

2
Your preparation for the examination should include attempting the following practical tasks by writing
and testing a program or programs.
A car park payment system allows customers to select the number of hours to leave their car in the car
park. The customer will get a discount if they enter their frequent parking number correctly. The system
calculates and displays the amount the customer must pay. The price of parking, the number of hours
the customer can enter, and any discount depend upon the day of the week and the arrival time. The
number of hours entered is a whole number. The price per hour is calculated using the price in force at
the arrival time. No parking is allowed between Midnight and 08:00.
Arrival time
Day of the week

From 08:00 to 15:59

From 16:00 to Midnight

Max stay in hours

Price per hour

Hours

Price

Sunday

8

2.00

Up to Midnight

2.00

Monday

2

10.00

Up to Midnight

2.00

Tuesday

2

10.00

Up to Midnight

2.00

Wednesday

2

10.00

Up to Midnight

2.00

Thursday

2

10.00

Up to Midnight

2.00

Friday

2

10.00

Up to Midnight

2.00

Saturday

4

3.00

Up to Midnight

2.00

A frequent parking number can be entered for discounted parking. This number consists of 4 digits and
a check digit that is calculated using a modulo 11 check digit calculation. A discount of 50% is available
for arrival times from 16:00 to Midnight; the discount is 10% at all other arrival times.
Write and test a program or programs to simulate the car park payment system.

•
•
•

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.
Task 1 – Calculating the price to park.
A customer inputs the day, the hour of arrival excluding minutes (for example 15:45 would be 15), the
number of hours to leave their car, and a frequent parking number if available. If the frequent parking
number has an incorrect check digit, then no discount can be applied. The price to park, based on
the day, the hour of arrival, the number of hours of parking required and any discount available, is
calculated and displayed.
Task 2 – Keeping a total of the payments.
Extend Task 1 to keep a daily total of payments made for parking. The daily total is zeroed at the start of
the day. For the simulation, each customer inputs the amount paid, this must be greater than or equal to
the amount displayed. There is no change given so the amount input may exceed the amount displayed.
Each customer payment is added to the daily total, and this total is displayed at the end of the day.
Task 3 – Making payments fairer.
Customers have complained that sometimes they are being charged too much if they arrive before
16:00 and depart after 16:00. Extend Task 1 to calculate the price before 16:00, then add the evening
charge. For example, a customer arriving at 14:45 on a Sunday and parking for five hours was
previously charged 10.00 and would now be charged 6.00
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.

© UCLES 2020

2210/22/PRE/M/J/20

Advertisement