Cambridge International General Certificate of Secondary Education
Cambridge International General Certificate of Secondary Education
Cambridge International General Certificate of Secondary Education
Write your Centre number, candidate number and name in the spaces at the top of this page.
Write in dark blue or black pen.
You may use an HB pencil for any diagrams, graphs or rough working.
Do not use staples, paper clips, glue or correction fluid.
DO NOT WRITE IN ANY BARCODES.
DO NOT ATTEMPT TASKS 1, 2 AND 3 in the pre-release material; these are for information only.
You are advised to spend no more than 40 minutes on Section A (Question 1).
No marks will be awarded for using brand names of software packages or hardware.
At the end of the examination, fasten all your work securely together.
The number of marks is given in brackets [ ] at the end of each question or part question.
The syllabus is approved for use in England, Wales and Northern Ireland as a Cambridge International Level 1/Level 2 Certificate.
DC (LK/SW) 125705/1
© UCLES 2016 [Turn over
2
Section A
You are advised to spend no longer than 40 minutes answering this section.
Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.
Pre-release Material
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.
• 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.
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
Output the name of the candidate voted for or output ‘invalid vote’ if a vote is rejected.
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’.
1 (a) All variables, constants and other identifiers should have meaningful names.
For four of the variables, constants or arrays that you used in Task 1, state the name, data
structure, data type and its use.
Name 1 ......................................................................................................................................
Use ............................................................................................................................................
Name 2 ......................................................................................................................................
Use ............................................................................................................................................
Name 3 ......................................................................................................................................
Use ............................................................................................................................................
Name 4 ......................................................................................................................................
Use ........................................................................................................................................[8]
(b) Write an algorithm to complete Task 2, using either pseudocode, programming statements
or a flowchart. You can assume that Task 1 has been completed and that there are three
candidates for class captain.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
..................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[4]
(c) Explain how you show the result (Task 3). You may include programming statements as part
of your explanation.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[6]
(d) Explain how you could extend your solution to deal with the case of ‘NO OVERALL WINNER’.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
Section B
• inputs 10 numbers
• checks whether each number is within a specified range
• totals the numbers within the range and outside the range
1 InRange = 0
2 OutRange = 1000
3 FOR Count = 1 TO 10
4 INPUT Num
5 IF Num > 10 AND Num < 20 THEN InRange = InRange + 1
6 ELSE OutRange = OutRange - 1
7 Count = Count + 1
8 NEXT X
9 PRINT InRange, OutRange
Error 1 ........................................................................................................................................
Correction ..................................................................................................................................
...................................................................................................................................................
Error 2 ........................................................................................................................................
Correction ..................................................................................................................................
...................................................................................................................................................
Error 3 ........................................................................................................................................
Correction ..................................................................................................................................
...................................................................................................................................................
Error 4 ........................................................................................................................................
Correction ..................................................................................................................................
...............................................................................................................................................[4]
(b) Decide, with reasons, whether the numbers 10 and 20 are within or outside the range.
Within Outside
Number Reason
range (✓) range (✓)
10
……………………………………………………………………..
……………………………………………………………………..
20
……………………………………………………………………..
……………………………………………………………………..
[4]
3 The flowchart below inputs the price of an item under $10. The change from a $10 note is output.
Any amount less than 5 cents is rounded up to 5 cents.
The predefined function INT rounds a number down to the nearest whole number; for example
Z ← INT(5.7) gives the value Z = 5
START
INPUT Price
Change 10 – Price
Is
Change Yes Dollars INT(Change)
>= 1?
OUTPUT Dollars,
" dollars"
Is
Change Yes
Change Change – 0.5
>= 0.5?
No OUTPUT "One 50
cent coin"
OUTPUT TenCents,
" ten cent coins"
No
END
[5]
Data is of a particular
Range check
specified type
5 REPEAT ... UNTIL and WHILE ... DO ... ENDWHILE are two different loop
structures you can use when writing pseudocode.
Explain, using examples, why you would choose to use each type of loop.
Example 1 .........................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
Example 2 .........................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
......................................................................................................................................................[6]
6 A database, THEATRETOURS, was set up to show the tour dates, towns, number of seats and
prices in local currency for a Shakespeare play.
(a) Explain why none of the fields in the database can be used as a primary key.
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(c) Use the query-by-example grid below to provide a list of tour dates and seat prices in
alphabetical order of town.
Field:
Table:
Sort:
Show:
Criteria:
or:
[4]
BLANK PAGE
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.