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

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

Advertisement
Loading the paper…
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

October/November 2016

PRE-RELEASE MATERIAL
No Additional Materials are required.
* 0 6 6 7 0 8 5 1 2 1 *

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 (LK) 125706
© 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 headteacher of a school needs a program to record and count the votes for a class captain. Each
student in the class will be allowed one vote. There can be up to 30 students in a class.
Write and test a program for the headteacher.
•
•
•

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 voting
Each class can choose from up to four different students as candidates for their class captain. Set up a
routine that allows:
•
•
•
•
•

between two and four different candidate names to be input and stored
the candidate names to be displayed with a number (1, 2, 3 or 4) beside each name
a choice of 1, 2, 3 or 4 to be entered to record a vote; all other entries are rejected
up to four totals set to zero ready to record the votes
a maximum of 30 votes to be cast

TASK 2 – Record and count each vote
Input a number 1, 2, 3 or 4; add 1 to the appropriate total.
Output the name of the candidate voted for or output ‘invalid vote’ if a vote is rejected.

TASK 3 – Show the result
When all the votes have been cast, display the candidates’ names with their totals in descending order
of totals. If there is a clear winner, display the candidate’s name with the words ‘NEW CLASS CAPTAIN’
beside it; otherwise display ‘NO OVERALL WINNER’.

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

Advertisement