Computer Science (0478) · Oct/Nov 2016 · PRE 22

Cambridge Computer Science (0478) pre for paper 22, Oct/Nov 2016 — 0478/22/O/N/16, file 0478_w16_pre_22.pdf.

Advertisement
Loading the paper…
Text of this paper

www.dynamicpapers.com

Cambridge International Examinations
Cambridge International General Certificate of Secondary Education

0478/22

COMPUTER SCIENCE
Paper 2 Problem-solving and Programming

October/November 2016

PRE-RELEASE MATERIAL
No Additional Materials are required.
* 4 0 4 2 7 2 6 0 3 3 *

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 (NF) 106770/3
© 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 supermarket needs a program to record donations to charity. Each customer has
the choice of three charities to donate to, and 1% of their shopping bill will be donated to the chosen
charity.
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 – Set up the donation system
Set up a routine that allows:
•
the names of three charities to be input and stored
•
the charity names to be displayed with a number (1, 2 or 3) beside each name
•
a choice of 1, 2 or 3 to be entered to choose the charity, all other entries rejected
•
the value of a customer’s shopping bill to be entered
•
the donation to be calculated
•
three totals to be set to zero ready to total each charity donation

TASK 2 – Record and total each donation
For a customer’s shopping bill:
•
input a charity choice of 1, 2 or 3
•
input the value of a customer’s shopping bill
•
calculate the donation
•
add the donation to the appropriate total
Output the name of the charity and the amount donated.

TASK 3 – Show the totals so far
Extend TASK 2 to accept:
•
donations from more customers
•
a charity choice of -1 to show the totals so far
Display the charities’ names and the totals in descending order of totals.
Calculate a grand total of all three totals.
Output ‘GRAND TOTAL DONATED TO CHARITY’ and the amount of the grand total.

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/22/PRE/O/N/16

Advertisement