Cambridge O Level: Computer Science 2210/21
Cambridge O Level: Computer Science 2210/21
Cambridge O Level: Computer Science 2210/21
PRE-RELEASE MATERIAL
* 0 9 3 2 9 0 7 7 4 6 *
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.
DC (LK) 212381/1
© UCLES 2021 [Turn over
2
Your preparation for the examination should include attempting the following practical tasks by writing
and testing a program or programs.
A system is required to record and count votes for candidates in school council elections. The voting
system will allow for one representative to be elected from a tutor group. The school has between 28 and
35 students in each tutor group, five year groups named Year 7 to Year 11, and there are six tutor groups
in each year group. Tutor group names are their year group followed by a single letter e.g. 7A, 7B, etc.
All students are allowed to vote in the system. Each student may only vote once for a representative
from their tutor group in the election.
You will need to complete these three tasks. Each task must be fully tested.
Task 1 – Setting up the voting system to allow a tutor group to elect a representative.
Write a program to:
• allow the tutor to enter the name of the tutor group
• allow the tutor to enter the number of students in the tutor group
• allow the tutor to enter the number of candidates in the election; maximum of four candidates
• allow the tutor to enter the names of the candidates and store them in a suitable data structure
• allow each student to input their vote or to abstain
• count the votes for each candidate and student abstentions.
When all students have voted, display the name of the tutor group, the votes for each candidate and the
name of the candidate who has won the election. If there is a tie for first place, display all candidates
with the equal highest number of votes.
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.