Computer Science (0478) · May/June 2016 · PRE 23
Cambridge Computer Science (0478) pre for paper 23, May/June 2016 — 0478/23/M/J/16, file 0478_s16_pre_23.pdf.
Text of this paper
www.dynamicpapers.com
Cambridge International Examinations
Cambridge International General Certificate of Secondary Education
0478/23
COMPUTER SCIENCE
Paper 2 Problem-solving and Programming
May/June 2016
PRE-RELEASE MATERIAL
No Additional Materials are required.
* 6 0 1 9 0 0 5 9 9 2 *
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.
The syllabus is approved 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 (ST) 124079
© UCLES 2016
[Turn over
www.dynamicpapers.com
2
In preparation for the examination candidates should attempt the following practical tasks by writing
and testing a program(s).
The manager of a parcel delivery service needs a program to check the size and weight of parcels to
determine which parcels can be accepted for delivery.
Write and test a program for the manager.
•
•
•
Your program must include appropriate prompts for the entry of data.
Error messages and other output need to be set out clearly.
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 – Check the size and weight of a single parcel
Each parcel must obey the following rules to be accepted for delivery:
•
each dimension must be no more than 80 cm
•
the sum of the three dimensions must be no more than 200 cm
•
the weight of the parcel must be between one and ten kilograms inclusive
Input and store the weight and dimensions for one parcel. All the dimensions and the weight must be
validated on entry and an unsuitable parcel rejected.
Output if the parcel is accepted or rejected. If rejected, output all the reasons why the parcel was
rejected.
TASK 2 – Check a customer’s consignment of parcels
Input and store the number of parcels in the consignment. Calculate the number of parcels accepted
and the total weight of the parcels accepted. For each parcel that was rejected, output all the reasons
why that parcel was rejected.
Output the number of parcels accepted and the total weight of parcels accepted.
Output the number of parcels rejected.
TASK 3 – Calculate the price for a customer’s consignment of parcels
Extend TASK 2 to also calculate the price for each parcel, using the following rules:
•
1 kg to 5 kg inclusive costs $10
•
Each 100 grams over 5 kg, up to 10 kg, costs an extra $0.10
Your output should also include the price for each parcel accepted and the total price of the consignment.
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 2016
0478/23/M/J/16