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.
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 (LEG/SW) 106771/3
© UCLES 2016 [Turn over
2
1 Read this section of program code that inputs 10 positive numbers and then outputs the smallest
number input.
1 Small = 1000
2 Counter = 0
3 REPEAT
4 INPUT Num
5 IF Num < Small THEN Small = Num
6 Counter = Counter + 1
7 UNTIL Counter = 10
8 PRINT Small
(i) Identify three changes you would need to make to find the largest number input instead
of the smallest number.
1 .........................................................................................................................................
...........................................................................................................................................
2 .........................................................................................................................................
...........................................................................................................................................
3 .........................................................................................................................................
.......................................................................................................................................[3]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
(i) Choose a suitable data type for each of the membership details to be recorded.
Name
Gender
Status
Fee
Team member
[5]
State the data structure that would be most suitable to use and give a reason for your
choice.
Reason ...............................................................................................................................
.......................................................................................................................................[2]
3 The flowchart below inputs the height of children who want to ride on a rollercoaster. Children
under 1.2 metres are rejected. The ride starts when eight children have been accepted.
67$57
5LGHUV
5HMHFW
,1387
+HLJKW
,V <HV
+HLJKW 5HMHFW5HMHFW
"
1R
5LGHUV5LGHUV
(1'
1.4, 1.3, 1.1, 1.3, 1.0, 1.5, 1.2, 1.3, 1.4, 1.3, 0.9, 1.5, 1.6, 1.0
[4]
Identify and describe two other types of loop structure that you could use when writing
pseudocode.
Description .................................................................................................................................
...................................................................................................................................................
Description .................................................................................................................................
...............................................................................................................................................[4]
5 A database table, STAFFPHONE, was set up to show the telephone extension numbers for members of
staff working in a department store.
(a) Explain why none of the fields in the database can be used as a primary key.
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(c) Write SQL statements to provide a list of all members of staff, in alphabetical
order, grouped by department.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[5]
6 Shop customers have a discount card with a unique card number. Customers collect points after
they have bought items. The more points they have, the bigger the discount. If they shop on a
Wednesday, their discount is increased by 20%.
The function GetDiscountRate() takes a card number as a parameter and returns the discount
rate for a customer based on the number of points they have collected. A flowchart for the function
is shown.
START
DRate 0
Points
GetPoints(CardNum)
Is YES
Points > 199 ? DRate 0.2
NO
Is YES
Points > 99 ? DRate 0.1
NO
NO
RETURN DRate
END
9
Your solution should follow the flowchart for the function as closely as possible. Variable
declarations should be included.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[8]
10
Name and describe one other type of error that the function could contain.
Name .................................................................................................................................
Description ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[2]
(c) There are different ways to minimise the risk of errors when writing programs, such as the
use of constants and library routines.
(i) Identify two values that could be replaced by constants in the function
GetDiscountRate().
...........................................................................................................................................
....................................................................................................................................... [1]
(ii) Write pseudocode to declare one of the constants you have given in part (c)(i).
....................................................................................................................................... [2]
(iii) Explain how the use of constants helps to minimise programming errors.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
....................................................................................................................................... [2]
11
(iv) Give a reason why the use of library routines helps to minimise the risk of errors when
writing a program.
...........................................................................................................................................
.......................................................................................................................................[1]
(v) Constants and library routines help to minimise the risk of errors.
Name another way that you can minimise the risk of errors when writing a program.
Explain how this helps.
Name .................................................................................................................................
Explanation .......................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[2]
12
Repetition
Statement Selection Assignment
(Iteration)
WHILE Count < 20
Count Count + 1
IF MyGrade <> 'C' THEN
Mark[Count] GetMark(StudentID)
ELSE OUTPUT "Fail"
ENDWHILE
[6]
Give the most appropriate data type for the variable used in each statement.
Complete the table by evaluating each expression using the values from part (b)(i).
Expression Evaluates to
SUBSTRING(Subject, 7, 3)
INT(MyAverage / 2)
ProjectCompleted AND MyMark > 270
ProjectCompleted OR MyMark > 260
LENGTH (MyGrade / 3)
[5]
13
8 (a) Complete the Boolean expession that corresponds to the following truth table.
INPUT OUTPUT
A B C X
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1
X = .......................................................................................................................
.......................................................................................................................
....................................................................................................................... [2]
14
9 (a) A multi-user computer system stores information about users. It uses a 1D array,
UserNameArray, of type STRING. There are 100 elements in the array.
<UserID><UserName>
You should assume that UserNameArray has been declared as a global variable.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[15]