Computer Science (0478) · Oct/Nov 2020 · PM 21
Cambridge Computer Science (0478) pm for paper 21, Oct/Nov 2020 — 0478/21/O/N/20, file 0478_w20_pm_21.pdf.
Text of this paper
www.dynamicpapers.com
Cambridge IGCSE™
COMPUTER SCIENCE
0478/21
Paper 2 Problem-solving and Programming
October/November 2020
PRE-RELEASE MATERIAL
* 5 9 5 4 0 8 1 6 1 6 *
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 (ST) 185128/1
© UCLES 2020
[Turn over
www.dynamicpapers.com
2
Your preparation for the examination should include attempting the following practical tasks by writing and
testing a program or programs.
A car insurance system allows customers to check how much it would cost to buy insurance for a car for
twelve months. The starting price of the car insurance is $500. The actual price a customer pays for the car
insurance changes depending upon this information:
• engine size of car
• value of car
• where car is kept overnight
• number of kilometres (km) driven a year
• age of driver
• years insured without an insurance claim
Engine
size in
litres
Price
change
Value in
$1000
Price
change
Kept
overnight
Price
change
1000 km
driven a
year
Price
change
Age of
driver
Price
change
Years
without
claim
Price
change
<=0.5
–5%
<0.5
–5%
Garage
–5%
<5
–5%
18–20
+100%
1
–10%
>0.5 to 1.0
0%
0.5 to 2
0%
Drive
0%
5 to 20
0%
21–25
+50%
2
–20%
>1.0 to 2.5
+5%
>2 to 10
+5%
Street
+5%
>20
+5%
26–30
+25%
3
–30%
>2.5
+10%
>10 to 20
+10%
31–70
0%
4
–40%
>20
+15%
71–80
+10%
5
–50%
>80
+20%
6
–60%
>6
–70%
Table 1
Table 2
The actual price is calculated by:
• finding the total of the percentage changes for the customer using Table 1
• applying this total percentage change to the starting price of the car insurance
• applying the years without claim discount percentage for the customer using Table 2.
Write and test a program or programs to calculate the price for a customer to insure a car.
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 – Calculate the price to insure a car.
Write a program to obtain the required information from a customer and calculate the price to insure the car.
Display the price to insure the car. Display the total percentage change calculated from Table 1, and the
years without claim discount percentage from Table 2 separately.
Task 2 – New customer discount.
Extend Task 1 to include an additional discount of 10% off the price to any new customer who is aged
between 26 and 70 inclusive, who also has 2 or more years without a claim. Display the amount of money
this would save and the new price.
Task 3 – Adding an extra driver.
Customers can add one extra driver. The age of the extra driver may increase the price. The new price is
calculated by applying the percentage price change for the age of the extra driver from Table 1 to the price.
Extend Task 2 to calculate and display the new price including an extra driver if required.
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
0478/21/PRE/O/N/20