Cambridge International Advanced Subsidiary and Advanced Level
Cambridge International Advanced Subsidiary and Advanced Level
Published
This mark scheme is published as an aid to teachers and candidates, to indicate the requirements of the
examination. It shows the basis on which Examiners were instructed to award marks. It does not indicate the
details of the discussions that took place at an Examiners’ meeting before marking began, which would have
considered the acceptability of alternative answers.
Mark schemes should be read in conjunction with the question paper and the Principal Examiner Report for
Teachers.
Cambridge will not enter into discussions about these mark schemes.
Cambridge is publishing the mark schemes for the October/November 2016 series for most
Cambridge IGCSE®, Cambridge International A and AS Level components and some Cambridge O Level
components.
1 (a)
© UCLES 2016
Page 3 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – October/November 2016 9608 22
Mark as follows:
• One mark per shape, correctly labelled (except for three assignments as noted
above)
• One mark for three selection values ('B', 'C' and 'D') [9]
(b)
PointsTotal PlayerGameGrade Updated Output
n A n n
n B n+1 n+1
n C n+3 n+3
n D n+5 n+5
13
e.g. 10 e.g. C 13
ELIMINATED
One mark per complete row testing different routes through the algorithm. [5]
(ii) 29 [1]
(iii) 14 // 16 [1]
(iv) 18 // 24 // 25 [1]
© UCLES 2016
Page 4 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – October/November 2016 9608 22
(d) (i)
Numbers
i j NextChar NextNumberString 1 2 3
1 1 '2'
""
"2"
2 '3' "23"
3 '*' 23
2 4 '7' ""
"7"
5 '3' "73"
6 '1'
4 10 '#'
• Isolates / separates / splits up each numeric string / the numbers / data string
separated by '*'
• Converts each numeric string / each number into an integer and
• Stores each integer in array (Numbers) [Max. 2]
© UCLES 2016
Page 5 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – October/November 2016 9608 22
(iii) 15 // 16 // 18 // 21 // 23 [1]
(iv) Statements inside the loop are enclosed by curly brackets {} // or by example,
such as {<statements>} [1]
• Control Structures
– Iteration
– Selection
– Sequence
– Layout / format (e.g. indentation)
• Modular features
– Objects
– Procedures / Functions
© UCLES 2016
Page 6 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – October/November 2016 9608 22
(b) ‘Pseudocode’ solution included here for development and clarification of mark scheme.
Programming language example solutions appear in the Appendix.
Mark as follows:
• Declaration of all variables used including data types
• Loop
• Assignment / calculation of (four) different random numbers (0 to 150) in a loop
• Output of four values
Mark as follows:
• Declaration of all variables used including data types
• Assignment of four different random numbers (0 to 150)
• Assignment to four separate variables
• Output of four values [4]
© UCLES 2016
Page 7 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – October/November 2016 9608 22
Pascal
FUNCTION GenerateNumber (AnyName : INTEGER) : INTEGER
Python
def GenerateNumber (AnyName):
• Mark as follows:
• Correct keyword + Function name
• Single input parameter of correct type
• Return parameter type [3]
(ii) • Use an array / list / file to store each number generated // a flag value
• Check the array / list / file to see if the new random number has already been drawn
• If YES, generate another number
• If NO, output the number and update the array / list / file [Max. 3]
5 (a) • 2D array
• of type integer
• with identifier PlayerScore [Max. 2]
(ii) ‘Pseudocode’ solution included here for development and clarification of mark scheme.
Programming language example solutions appear in the Appendix.
CLOSEFILE "NAMES.TXT"
© UCLES 2016
Page 8 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – October/November 2016 9608 22
(iii) ‘Pseudocode’ solution included here for development and clarification of mark scheme.
Programming language example solutions appear in the Appendix.
REPEAT
IF ThisPlayerName = PlayerName[i]
THEN
Found ← TRUE
PlayerNumber ← i
ELSE
i ← i + 1
ENDIF
(ii)
… True
… False
Line 5:
The boundary value must be included //
IF PlayerScore[GameIndex, PlayerIndex] >= 100 // > 99
Line 9:
The boundary value must be included //
IF PlayerScore[GameIndex, PlayerIndex] >= 50 // > 49
Line 11:
One should be added to Total50 (not GameIndex) //
Total50 ← Total50 + 1
© UCLES 2016
Page 9 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – October/November 2016 9608 22
(iii) 41 [1]
© UCLES 2016
Page 10 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – October/November 2016 9608 22
Randomize()
Dim i As Integer
Dim NextNumber As Integer
For i = 1 To 4
NextNumber = 1 + Int(Rnd() * 150)
Console.WriteLine(NextNumber)
Next
OR
Randomize()
Dim Num1, Num2, Num3, Num4 As Integer
Num1 = 1 + Int(Rnd() * 150)
Num2 = 1 + Int(Rnd() * 150)
Num3 = 1 + Int(Rnd() * 150)
Num4 = 1 + Int(Rnd() * 150)
Console.WriteLine(Num1, Num2, Num3, Num4)
Q4 (b): Pascal
Var i : Integer;
NextNumber : Integer;
Begin
Randomize;
For i := 1 To 4 Do
Begin
NextNumber := 1 + Random(150);
Writeln(NextNumber);
End;
Readln;
End.
OR
© UCLES 2016
Page 11 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – October/November 2016 9608 22
Q4 (b): Python
import random
# i : Integer
# NextNumber : Integer
for i in range(1, 5) :
NextNumber = 1 + int(150 * random.random())
print(NextNumber)
Alternative:
import random
# i Integer
# NextNumber Integer
for i in range(1, 5) :
NextNumber = random.randint(1, 150)
print(NextNumber)
OR
import random
# i Integer
# Num1, Num2, Num3, Num4 Integer
© UCLES 2016
Page 12 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – October/November 2016 9608 22
Alternative:
Alternative:
© UCLES 2016
Page 13 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – October/November 2016 9608 22
Alternative:
© UCLES 2016
Page 14 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – October/November 2016 9608 22
Alternative:
# PlayerName : List
# NextPlayer : String
# File : File handle
# i : Integer
File = open("Names.txt", "r")
PlayerName = []
for i in range(1, 9) :
NextPlayer = File.readline()
PlayerName.append(NextPlayer)
File.close()
Alternative:
# PlayerName : List
# NextPlayer : String
# File : File handle
# i : Integer
File = open("Names.txt", "r")
PlayerName = ["" for i in range(8)]
for i in range(1, 9) :
PlayerName[i – 1] = File.readline()
File.close()
© UCLES 2016
Page 15 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – October/November 2016 9608 22
Found = False
i = 1
Do
If ThisPlayerName = PlayerName(i) Then
Found = True
PlayerNumber = i
Else
i = i + 1
End If
Loop Until Found = True Or i = 9
Begin
Found := False;
i := 1;
Repeat
If (ThisPlayerName = PlayerName[i]) Then
Begin
Found := True;
PlayerNumber := i;
End
Else
i := i + 1;
Until (Found) Or (i = 9);
End.
Found = FALSE
PlayerName = [j.strip() for j in PlayerName]
if ThisPlayerName in PlayerName :
PlayerNumber = PlayerName.index(ThisPlayerName) + 1
Found = TRUE
Alternative:
Found = False
i = 1
while not Found and i < 9 :
if ThisPlayerName == PlayerName[i].strip() :
Found = True
PlayerNumber = i
else :
i = i + 1
Alternative:
Found = False
for i in range(1, 9) :
if ThisPlayerName == PlayerName[i].strip() :
Found = True
PlayerNumber = i
© UCLES 2016