Computer Science (9608) · May/June 2018 · Mark scheme 41
Cambridge Computer Science (9608) mark scheme for paper 41, May/June 2018 — 9608/41/M/J/18, file 9608_s18_ms_41.pdf.
Text of this paper
www.dynamicpapers.com
Cambridge Assessment International Education
Cambridge International Advanced Subsidiary and Advanced Level
COMPUTER SCIENCE
9608/41
Paper 4 Written Paper
May/June 2018
MARK SCHEME
Maximum Mark: 75
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 International will not enter into discussions about these mark schemes.
Cambridge International is publishing the mark schemes for the May/June 2018 series for most
Cambridge IGCSE™, Cambridge International A and AS Level and Cambridge Pre-U components, and
some Cambridge O Level components.
IGCSE™ is a registered trademark.
This document consists of 19 printed pages.
© UCLES 2018
[Turn over
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Generic Marking Principles
May/June 2018
www.dynamicpapers.com
These general marking principles must be applied by all examiners when marking candidate answers. They should be applied alongside the
specific content of the mark scheme or generic level descriptors for a question. Each question paper and mark scheme will also comply with these
marking principles.
GENERIC MARKING PRINCIPLE 1:
Marks must be awarded in line with:
•
•
•
the specific content of the mark scheme or the generic level descriptors for the question
the specific skills defined in the mark scheme or in the generic level descriptors for the question
the standard of response required by a candidate as exemplified by the standardisation scripts.
GENERIC MARKING PRINCIPLE 2:
Marks awarded are always whole marks (not half marks, or other fractions).
GENERIC MARKING PRINCIPLE 3:
Marks must be awarded positively:
•
•
•
•
•
marks are awarded for correct/valid answers, as defined in the mark scheme. However, credit is given for valid answers which go beyond the
scope of the syllabus and mark scheme, referring to your Team Leader as appropriate
marks are awarded when candidates clearly demonstrate what they know and can do
marks are not deducted for errors
marks are not deducted for omissions
answers should only be judged on the quality of spelling, punctuation and grammar when these features are specifically assessed by the
question as indicated by the mark scheme. The meaning, however, should be unambiguous.
GENERIC MARKING PRINCIPLE 4:
Rules must be applied consistently e.g. in situations where candidates have not followed instructions or in the application of generic level
descriptors.
© UCLES 2018
Page 2 of 19
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
May/June 2018
www.dynamicpapers.com
GENERIC MARKING PRINCIPLE 5:
Marks should be awarded using the full range of marks defined in the mark scheme for the question (however; the use of the full mark range may
be limited according to the quality of the candidate responses seen).
GENERIC MARKING PRINCIPLE 6:
Marks awarded are based solely on the requirements as defined in the mark scheme. Marks should not be awarded with grade thresholds or
grade descriptors in mind.
© UCLES 2018
Page 3 of 19
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Question
1(a)
Answer
1 mark per fact
May/June 2018
www.dynamicpapers.com
Marks
2
14 direct(london, rome).
15 flies(rome, british_air).
1(b)
1 mark per bullet:
• palma
• salzburg
2
K = palma, salzburg
1(c)
1 mark per bullet:
• direct
• glasgow, M
2
direct(glasgow, M).
1(d)
1 mark per bullet:
• flies(Z,X)
• AND
• direct(Z, Y)
3
flies(Z, X) AND direct(Z, Y)
1(e)
© UCLES 2018
YES
1
Page 4 of 19
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Question
2(a)
Answer
1 mark for each completed statement
MaxIndex ← 20
02
NumberItems ← MaxIndex – 1 // 19
03
FOR Outer ← 1 TO MaxIndex – 1 // 19
04
FOR Inner ← 1 to NumberItems
IF ItemList[Inner] > ItemList[Inner + 1]
06
THEN
07
Temp ← ItemList[Inner]
08
ItemList[Inner] ← ItemList[Inner + 1]
09
ItemList[Inner + 1] ← Temp
10
2(b)(i)
ENDFOR
12
NumberItems ← NumberItems - 1
2
Iterations continue // it continues doing comparisons
«after the array is sorted
1 mark per bullet to max 3
•
•
•
•
•
© UCLES 2018
ENDFOR
1 mark per bullet
•
•
2(b)(ii)
ENDIF
11
13
Marks
7
01
05
May/June 2018
www.dynamicpapers.com
3
Use of a flag to indicate if any swaps have taken place
If the inner loop has made all comparisons with no changes
«flag/value set accordingly
A comparison checks the flag/value at the end of each inner loop
«if it is sorted it breaks out/stops
Page 5 of 19
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Question
2(c)
Answer
1 mark per bullet to max 4
© UCLES 2018
Marks
4
e.g.
• When the list is almost sorted «
• «because it will stop as soon as it is sorted
•
•
May/June 2018
www.dynamicpapers.com
When there are a large number of data items «
«because it will perform fewer comparisons/loops
Page 6 of 19
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Question
3(a)
Answer
1 mark per bullet
•
•
•
•
•
Marks
5
OpenAccount, OperateAccount and Close Account on same level
RequestCloseAccount under OperateAccount
«SubscriptionDue under RequestCloseAcount
«Make Payment and PlaySong under SubscriptionDue
Correct selection and iteration throughout
*
© UCLES 2018
May/June 2018
www.dynamicpapers.com
Page 7 of 19
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Question
3(b)
Answer
Marks
1 mark per bullet
•
•
•
•
4
Downloaded?
Download and Not downloaded beneath downloaded
Delete song and play song beneath Downloaded (2) and Download song and stream song beneath not downloaded
All selections correct
Select Song
Downloaded?
Downloaded
Delete Song
© UCLES 2018
May/June 2018
www.dynamicpapers.com
Play Song
Not
Downloaded
Download
Song
Page 8 of 19
Stream Song
960
08/41
Ca
ambridge Interna
ational AS/A Lev
vel – Mark Scheme
PUBLISHED
Question
4(a)
Answer
1 ma
ark per bullet
•
•
•
•
•
May/June 2018
www.dynamicpapers.com
Marrks
5
C
C, D and E all co
oming from 3
G following D an
nd E
F following C
H from 6 to 7
I from 7 to 8
4(b)
1 ma
ark per bullet
• A
AÆBÆEÆGÆH
HÆI
• 3
30 days
2
4(c)
1 ma
ark per bullet
• E
Earliest start time: 19 days
• L
Latest finish time
e: 22 days
2
© UCLES 2018
Page 9 of 19
960
08/41
Ca
ambridge Interna
ational AS/A Lev
vel – Mark Scheme
PUBLISHED
Question
5(a)
Answer
1 ma
ark for each bulle
et:
•
•
•
© UCLES 2018
May/June 2018
www.dynamicpapers.com
Marrks
3
A
AnimatedElement attributes
P
Player methods
Inheritance arrow
ws
Page 10 of 19
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Question
5(b)
May/June 2018
www.dynamicpapers.com
Answer
1 mark per bullet to max 6
•
•
•
•
•
•
•
6
class declaration
private declaration of five attributes
constructor declaration
«initialisation of attributes to the parameter values
declaration of GetDetails function
appropriate concatenation of string using attributes
return of all 5 values in one string
Python example code:
class GameElement:
def __init__(self, PositionX, PositionY, Width, Height,
ImageFilename):
self.__PositionX = PositionX
self. __PositionY = PositionY
self. __Width = Width
self. __Height = Height
self. __ImageFilename = String
def GetDetails(self):
Message = "Position_x:", self. __PositionX, "Position_y:", self. __PositionY,
"width:", self. __Width, "height:", self. __Height, "ImageFilename", self.
__ImageFilename)
return Message
© UCLES 2018
Marks
Page 11 of 19
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Question
5(b)
Answer
Visual Basic example code:
Class GameElement
Private PositionX As Integer
Private PositionY As Integer
Private Width As Integer
Private Height As Integer
Private ImageFilename As String
Public Sub New(ByVal X As Integer,ByVal Y As Integer,
ByVal W As Integer, ByVal H As Integer, Filename As String )
PositionX = X
PositionY = Y
Width = W
Height = H
ImageFilename = Filename
End Sub
Public Function GetDetails()
Dim Message As String
Message = "PositionX: " + PositionX + "PositionY: " +
PositionY + ", width: " + Width + ", height: " +
Height + ", ImageFilename:" + ImageFilename
Return Message
End Function
End Class
© UCLES 2018
Page 12 of 19
May/June 2018
www.dynamicpapers.com
Marks
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Question
5(b)
Answer
Pascal example code:
type GameElement = class
private
PositionX : Integer;
PositionY : Integer;
Width : Integer;
Height : Integer;
ImageFilename : String;
public
Constructor init(X, Y, W, H:Integer; Filename: String);
Function GetDetails() : String;
end;
Constructor GameElement.init(X, Y, W, H:Integer; Filename: String);
begin
PositionX := X;
PositionY := Y;
Width := W;
Height := H;
ImageFilename := Filename;
end;
Function GameElement.GetDetails() : String;
var Message:String;
begin
Message = "PositionX: " + PositionX + "PositionY: " + PositionY
+ ", width: " + Width + ", height: " + Height + ",
ImageFilename:" + ImageFilename;
Result = Message
end;
© UCLES 2018
Page 13 of 19
May/June 2018
www.dynamicpapers.com
Marks
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Question
5(c)
Answer
Max 4 from each section to max 6 overall
class declaration with inheritance
constructor declaration
«taking all 5 parameters and CauseDamage, DamagePoints parameters
«with inheritance constructor call
Declaring CauseDamage, DamagePoints private and assigning parameters
1 mark per bullet to max 4
•
•
•
•
Function declaration for GiveDamagePoints «
«checking if CauseDamage = True
«returning DamagePoints if true
«else returning appropriate value e.g. -1/null/blank
Python example code:
class Scenery(GameElement):
def __init__(self, PositionX, PositionY, Width, Height,
ImageFilename, CauseDamage, DamagePoints):
Object.__init__(self, PositionX, PositionY, Width, Height,
ImageFilename)
self.__CauseDamage = CauseDamage
self.__DamagePoints = DamagePoints
def GiveDamagePoints(self):
if(self.__CauseDamage):
return self.__DamagePoints
else:
return 0
© UCLES 2018
Marks
6
1 mark per bullet to max 4
•
•
•
•
•
May/June 2018
www.dynamicpapers.com
Page 14 of 19
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Question
5(c)
Answer
Visual Basic example code:
Class Scenery
Inherits GameElement
Private CauseDamage As Boolean
Private DamagePoints As Integer
Public Sub New(ByVal X As Integer,ByVal Y As Integer, ByVal W As
Integer, ByVal H As Integer,Filename As String,
ByVal CD As Boolean, ByVal DP As Integer)
MyBase.New(X, Y, W, H, Filename)
CauseDamage = CD
DamagePoints = DP
End Sub
Public Function GiveDamagePoints() As Integer
If (CauseDamage) Then
Return DamagePoints
Else
Return 0
End if
End Function
End Class
© UCLES 2018
Page 15 of 19
May/June 2018
www.dynamicpapers.com
Marks
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Question
5(c)
Answer
Pascal example code:
Scenery = class(GameElement)
private
CauseDamage : Boolean;
DamagePoints: Integer;
public
Constructor init(X, Y, W, H: Integer; Filename: String;
CD:Boolean; DP: Integer); override;
Function GiveDamagePoints() : Integer;
end;
constructor Scenery.init(X, Y, W, H: Integer; Filename: String; CD:
Boolean; DP: Integer);
begin
inherited init(X, Y, W, H, Filename);
CauseDamage := CD;
DamagePoints := DP;
end;
Function Scenery.GiveDamagePoints() : Integer;
begin
if (CauseDamage):
Result := DamagePoints
else:
Result := 0;
end;
© UCLES 2018
Page 16 of 19
May/June 2018
www.dynamicpapers.com
Marks
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Question
5(d)(i)
Answer
1 mark per bullet
•
•
•
Marks
3
Variable GiftBox assigned value
Call Scenery
With all 7 parameters assigned correctly
Python example code:
GiftBox = Scenery(150, 150, 50, 75, "box.png", True, 50)
Visual Basic example code:
GiftBox = Scenery(150, 150, 50, 75, "box.png", True, 50)
Pascal example code:
GiftBox := Scenery(150, 150, 50, 75, "box.png", True, 50)
© UCLES 2018
May/June 2018
www.dynamicpapers.com
Page 17 of 19
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Question
5(d)(ii)
Answer
Marks
1 mark per bullet
• Function declaration with no parameters
• Use inherited GetDetails method to get string
• Return all values
3
def GetScenery(self):
Message = Object.GetDetails(self)
Message = Message + " Causes Damage:", self.CauseDamage, “Damage
Points:", self.DamagePoints
return Message
Visual Basic example code:
Public Function GetScenery() As String
Dim Message As String
Message = MyBase.GetDetails()
Message = Message + "CauseDamage: " + CauseDamage +
DamagePoints: " + DamagePoints
Return Message
End Function
"
Pascal example code:
Function Secenery.GetScenery(): String
Var Message : String
Begin
Message := GetDetails();
Message := Message + "CauseDamage: " + CauseDamage +
DamagePoints: " + DamagePoints;
Result:=Message;
End;
© UCLES 2018
May/June 2018
www.dynamicpapers.com
Page 18 of 19
"
9608/41
Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Question
6(a)(i)
Answer
1 mark per bullet:
•
•
•
May/June 2018
www.dynamicpapers.com
Marks
3
TYPE ListNode declaration and ENDTYPE
DECLARE Player : String
DECLARE Pointer : INTEGER
TYPE ListNode
DECLARE Player : STRING
DECLARE Pointer : INTEGER
ENDTYPE
6(a)(ii)
1 mark per bullet:
•
•
2
DECLARE Scorers : ARRAY[0:9]
OF ListNode
DECLARE Scorers : ARRAY[0:9] OF ListNode
6(b)
1 mark for each completed statement
5
FUNCTION SearchList(Find, Position) RETURNS INTEGER
IF Scorer[Position].Player = Find
THEN
RETURN Position
ELSE
IF Scorer[Position].Player <> -1
THEN
Position ← SearchList(Find, Scorer[Position].Pointer)
RETURN Position
ELSE
RETURN 99
ENDIF
ENDIF
ENDPROCEDURE
© UCLES 2018
Page 19 of 19