Computer Science (0478) · Oct/Nov 2019 · PM 21
Cambridge Computer Science (0478) pm for paper 21, Oct/Nov 2019 — 0478/21/O/N/19, file 0478_w19_pm_21.pdf.
Text of this paper
www.dynamicpapers.com
Cambridge Assessment International Education
Cambridge International General Certificate of Secondary Education
0478/21
COMPUTER SCIENCE
Paper 2 Problem-solving and Programming
October/November 2019
PRE-RELEASE MATERIAL
* 4 4 1 7 9 7 5 5 6 4 *
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 syllabus is regulated for use in England, Wales and Northern Ireland as a Cambridge International Level 1/Level 2 Certificate.
This document consists of 2 printed pages.
DC (NH) 162396/3
© UCLES 2019
[Turn over
www.dynamicpapers.com
2
In preparation for the examination candidates should attempt the following practical tasks by writing
and testing a program or programs.
You have been asked to write a program to calculate the area of a patio and the cost of the stone slabs
needed to cover it. The program should work for any patio that can be represented as a rectangle, or
group of rectangles that are joined together, and only one type of stone slab may be used.
Type of stone slab
Price per square metre
Dover
$30.00
Exeter
$35.00
London
$42.00
Portland
$49.50
Shaftesbury
$55.00
York
$62.75
Write and test a program or programs to calculate the cost of the stone slabs for a patio.
•
•
•
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 – Setting up the system for a simple rectangular patio.
Set up your program to:
•
Store the type and price per square metre of the stone slabs using a suitable programming
technique.
•
Prompt and allow the user to input the length and width of their patio and the type of stone slab
they would like.
•
Calculate and display the number of square metres of stone slabs required, rounded up to the
next whole square metre, and the total cost of the stone slabs.
Task 2 – Working on more complex shapes.
Assuming that a patio can be made up of a group of rectangles, extend your program to:
•
Enter the number of rectangles making up the patio and the type of stone slab to be used.
•
Allow the dimensions for each rectangle to be entered.
•
Calculate and display the total area of the patio rounded up to the next whole square metre.
•
Calculate and display the total cost of the stone slabs.
Task 3 – Allowing for waste.
It is likely that some of the stone will not be useable, so it is sensible to allow a percentage for wastage,
for example, 10%. Alter your program to allow the user to input a percentage to calculate wastage and
add this to the number of square metres of stone slabs to be purchased, rounded up to the next whole
square metre. Display the revised total area and cost.
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 2019
0478/21/PRE/O/N/19