Computer Science (9608) · May/June 2019 · Mark scheme 42

Cambridge Computer Science (9608) mark scheme for paper 42, May/June 2019 — 9608/42/M/J/19, file 9608_s19_ms_42.pdf.

Advertisement
Loading the paper…

More Computer Science (9608) papers

Paper 42 in other years

All Computer Science papers
Text of this paper

Cambridge Assessment International Education
Cambridge International Advanced Subsidiary and Advanced Level

COMPUTER SCIENCE

9608/42

Paper 4 Written Paper

May/June 2019

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 2019 series for most
Cambridge IGCSE™, Cambridge International A and AS Level and Cambridge Pre-U components, and
some Cambridge O Level components.

This document consists of 21 printed pages.
© UCLES 2019

[Turn over

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED
Generic Marking Principles

May/June 2019

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.
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).
© UCLES 2019

Page 2 of 21

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

May/June 2019

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 2019

Page 3 of 21

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
1(a)(i)

Answer
1 mark per bullet point
•
•
•
•
•

© UCLES 2019

May/June 2019
Marks
5

13 to left of 21
34 to right of 21
54 to left of 65
53 to left of 54
Null and other pointers on all boxes written and no other pointers filled in

Page 4 of 21

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
1(a)(ii)

Answer

6

FreePointer
36
45
21 and 65
66 and 13
54, 53 and 34
RootPointer

Index

LeftPointer

Data

RightPointer

0

[0]
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]

2
null
5
6
null
null
7
null
null

36
45
21
65
66
13
54
53
34

1
3
8
4
null
null
null
null
null

FreePointer
9

© UCLES 2019

Marks

1 mark per bullet point
•
•
•
•
•
•

May/June 2019

Page 5 of 21

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
1(b)(i)

Answer

Marks

1 mark per bullet point
•
•
•
•
•

5

Language specific constructor header and close (where appropriate)
«with two parameters (variables)
Initialise FinalMark to 0
Initialise Grade to "Fail"
Initialise PaperID to CentreNumber + CandidateNumber

PYTHON
def__init__(self, CentreNumber,CandidateNumber):
self.__FinalMark = 0
self.__Grade = "Fail"
self.__PaperID = CentreNumber + CandidateNumber
PASCAL
Contructor NewExaminationPaper.Create(CentreNumber
begin
FinalMark := 0;
Grade := 'Fail';
PaperID := CentreNumber + CandidateNumber;
end;

: String, CandidateNumber : String);

VB
Public Sub New (ByVal CentreNumber As String, ByVal CandidateNumber As String)
FinalMark = 0
Grade = "Fail"
PaperID = CentreNumber & CandidateNumber
End Sub

© UCLES 2019

May/June 2019

Page 6 of 21

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
1(b)(ii)

Answer
1 mark per bullet point to max 3
•
•
•
•
•
•
•
•
•

© UCLES 2019

May/June 2019
Marks
3

Used to access/change the properties/attributes
«only using the get/set methods
«that are set to private
Provide encapsulation
Prevents accidental change
To make sure data is valid // act as validation
Hides data
The get methods allow the data to be accessed/returned
The set methods allow the data to be changed/written to

Page 7 of 21

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
1(b)(iii)

Answer
1 mark per bullet point
•
•
•
•

Marks
4

1 get method header without parameter (returning string where appropriate)
«returning the property
A second working Get
A third working Get

PYTHON
def GetFinalMark():
return (FinalMark)
def GetGrade():
return (Grade)
def GetPaperID():
return (PaperID)
PASCAL
function GetFinalMark():Integer;
begin
GetFinalMark:= FinalMark;
end;
function GetGrade():String;
begin
GetGrade:= Grade;
end;
function GetPaperID():string;
begin
GetPaperID:= PaperID;
end;

© UCLES 2019

May/June 2019

Page 8 of 21

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
1(b)(iii)

Answer
VB
Public Function GetFinalMark() As Integer
Return FinalMark
End Function
Public Function GetGrade() As String
Return Grade
End Function
Public Function GetPaperID() As String
Return PaperID
End Function

© UCLES 2019

Page 9 of 21

May/June 2019
Marks

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
1(b)(iv)

Answer
1 mark per bullet point
•
•
•
•
•

Marks
5

Set header taking parameter and close (where appropriate
check if parameter >= 0 and <= 90
If valid (>=0 and <=90) return TRUE
«and set FinalMark to parameter
If not valid, return FALSE and do not set FinalMark

PYTHON
def SetFinalMark (Mark):
if Mark >=0 and Mark <=90:
IsValid = True
FinalMark = Mark
else:
IsValid = False
return(IsValid)
PASCAL
function SetFinalMark (Mark: Integer) : Boolean;
var IsValid : Boolean;
begin
If (Mark >=0) AND (Mark <=90) Then
FinalMark := Mark;
IsValid := True;
Else
IsValid :=False;
end;

© UCLES 2019

May/June 2019

Page 10 of 21

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
1(b)(iv)

Answer
VB
Public Function SetFinalMark(ByVal Mark As Integer) As Boolean
If (Mark >=0) And (Mark <=90) Then
FinalMark = Mark
Return True
Else
Return False
End If
End Function

© UCLES 2019

Page 11 of 21

May/June 2019
Marks

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
1(b)(v)

Answer
1 mark per bullet point
•
•
•
•

Marks
4

Procedure header with three parameters (and close where appropriate)
Check if FinalMark is >= DistMark and Grade set to Distinction
Check if FinalMark is >= MeritMark and <DistMark and Grade set to Merit
Check if FinalMark is >= PassMark and <MeritMark and Grade set to Pass
Otherwise Grade set to Fail

PYTHON
def SetGrade(DistMark, MeritMark, PassMark):
if FinalMark >= DistMark:
Grade = "Distinction"
elif FinalMark >= MeritMark:
Grade = "Merit"
elif FinalMark >= PassMark:
Grade = "Pass"
else:
Grade = "Fail"
PASCAL
procedure SetGrade(DistMark, MeritMark, PassMark)
begin
If FinalMark >= DistMark Then
Grade := "Distinction";
Else If FinalMark >= MeritMark Then
Grade := "Merit";
Else If FinalMark >= PassMark Then
Grade:= "Pass";
Else
Grade:= "Fail";
end;

© UCLES 2019

May/June 2019

Page 12 of 21

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
1(b)(v)

Answer
VB
Public Sub SetGrade(DistMark, MeritMark, PassMark)
If FinalMark >= DistMark Then
Grade = "Distinction"
ElseIf FinalMark >= MeritMark Then
Grade = "Merit"
ElseIf FinalMark >= PassMark Then
Grade = "Pass"
Else
Grade = "Fail"
End If
End Sub

© UCLES 2019

Page 13 of 21

May/June 2019
Marks

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
1(b)(vi)

Answer
1 mark per bullet point to max 8
•
•
•
•
•
•
•
•
•
•

Marks
8

Procedure Main header and close (where appropriate)
Input candidate number, centre number and mark with suitable prompt(s)
Create instance of ExaminationPaper named ThisPaper«
« with input parameters candidate number and centre number
Call SetFinalMark for ThisPaper with mark input as parameter
«storing/using return value
«outputting a message if this is valid or invalid
Call SetGrade for ThisPaper with correct thresholds
Output grade for ThisPaper «
«using .GetGrade

PYTHON
def main():
candidateNumber = input("Please enter the candidate number")
centreNumber = input("Please enter the centre number")
mark = input("Please enter the mark")
ThisPaper = ExaminationPaper(centreNumber, candidateNumber)
if ThisPaper.SetFinalMark(mark) == FALSE:
print("Invalid mark")
else:
ThisPaper.SetGrade(80, 70, 55)
print(ThisPaper.GetGrade())

© UCLES 2019

May/June 2019

Page 14 of 21

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
1(b)(vi)

Answer
PASCAL
procedure Main();
var
candidateNumber, centreNumber : String;
isValid : boolean;
thisPaper : ExaminationPaper;
mark : integer;
begin
Writeln(Enter candidate number: ');
Readln(candidateNumber);
Writeln('Enter centre number: ');
Readln(centreNumber);
ThisPaper := ExaminationPaper.Create(centreNumber, candidateNumber);
Writeln('Enter mark: ');
Readln(mark);
isValid := ThisPaper.SetFinalMark(mark);
if isValid = true:
thisPaper.SetGrade(80, 70, 55);
Writeln(ThisPaper.GetGrade());
else:
Writeln("Invalid mark")
end;

© UCLES 2019

Page 15 of 21

May/June 2019
Marks

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
1(b)(vi)

Answer

May/June 2019
Marks

VB
Sub main()
Dim candidateNumber As String
Dim centreNumber As String
Console.WriteLine("Please enter the candidate number")
candidateNumber = Console.ReadLine()
Console.WriteLine("Please enter the centre number")
centreNumber = Console.ReadLine()
Dim ThisPaper As New ExaminationPaper(centreNumber, candidateNumber)
Dim IsValid As Boolean
Console.WriteLine("Please enter the mark")
Dim mark As Integer
mark = Console.ReadLine()
IsValid = ThisPaper.SetFinalMark(mark)
if IsValid = True then
ThisPaper.SetGrade(80, 70, 55)
Console.WriteLine(ThisPaper.GetGrade())
else
Console.WriteLine("Invalid mark")
endif
End Sub

1(c)

1 mark per bullet point to max 4
•
•
•
•
•
•

© UCLES 2019

4

There are a large number of objects/records to store // hash is better for a large number of objects/records
A hashing algorithm/hash performed on key field/record (to form the address)
«to allow direct access to the object
«so it is likely to be faster in finding the object // linked list is slower in finding the object
In a linked list, each object needs to be checked until found // sequentially/linear accessed
«the left/right/next pointer is followed // have to trace pointers

Page 16 of 21

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
2(a)

Answer
1 mark for correct tick
Statement
Last in first out

May/June 2019
Marks
1

Tick
(9)
9

First in first out
Last in last out
2(b)(i)

1 mark for correct stack

1

10
35
20
2(b)(ii)

1 mark for correct stack

1

65
50
35
20

© UCLES 2019

Page 17 of 21

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
2(b)(iii)

Answer
1 mark for each bullet
•
•
•
•
•
•
•

Marks
7

Function Push «
«taking parameter (returning Boolean)
Checking if Top = 7 «
«returning FALSE if full
«returning TRUE otherwise
if not full, increment Top
... add parameter to Top of ArrayStack

FUNCTION Push (BYVALUE DataItem : Integer) (RETURNS Boolean)
IF Top = 7
THEN
RETURN FALSE
ELSE
Top ← Top + 1
ArrayStack[Top] ← DataItem
RETURN TRUE
ENDIF
ENDFUNCTION

© UCLES 2019

May/June 2019

Page 18 of 21

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
3(a)

3(b)

Answer
1 mark for name of feature; 1 mark for description
e.g.

© UCLES 2019

Marks
4

•
•

Colouring code//Pretty printing
This is how the code is presented in the IDE e.g. colour coding and indentation

•
•

Context-sensitive prompts
Displays keywords or hints at the point of insertion e.g. drop-down list of commands

•
•

Auto-indent
Automatically indent your code for selection/iteration/procedures/methods

•
•

Auto-complete
Avoid typing errors // speeds up process of typing

•
•

Expand/collapse subroutines/code
To make it easier to view code currently working on

1 mark per each correct bullet point
•
•
•

May/June 2019

3

Normal
Abnormal / erroneous / invalid
Boundary / extreme

Page 19 of 21

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
4(a)(i)

May/June 2019

Answer

Marks

1 mark for error and correction

4

Error 1 – IF List[LowerBound] = SearchValue
Correction – IF List[MidPoint] = SearchValue
Error 2 – UpperBound ← MidPoint + 1
Correction – LowerBound ← MidPoint + 1
Error 3 – IF LowerBound > MidPoint
Correction - IF LowerBound > UpperBound
Error 4 – IF ValueFound = FALSE
Correction – IF ValueFound = TRUE
4(a)(ii)

Linear search

1

4(b)(i)

1 mark per shaded section

4

© UCLES 2019

Count

TempValue

Sorted

0
1
2
3
4
0
1
2
3
4

""
12

TRUE
FALSE

29

(FALSE)
TRUE

0
5

1
20
12

ArrayData
2
3
12
25
20

Page 20 of 21

4
32

5
29

29

32

9608/42

Cambridge International AS/A Level – Mark Scheme
PUBLISHED

Question
4(b)(ii)

Answer
1 mark per bullet point
•
•
•

May/June 2019
Marks
3

Initialising a counter variable to 0 and must be the same variable used to access array elements
While loop checking counter is < 5 or <= 4
Incrementing counter inside the loop and outside IF, and remainder of algorithm completed (The IF to ENDIF)

e.g.
Count ← 0
WHILE Count < 5
IF ArrayData[Count] > ArrayData[Count + 1]
THEN
TempValue ← ArrayData[Count + 1]
ArrayData[Count + 1] ← ArrayData[Count]
ArrayData[Count] ← TempValue
Sorted ← False
ENDIF
Count ← Count + 1
ENDWHILE
4(b)(iii)

Bubble sort

1

4(b)(iv)

One from:

1

•
•
•

© UCLES 2019

Insertion sort
Merge sort
Quick sort

Page 21 of 21

Advertisement