Computer Science (9608) · Oct/Nov 2019 · Mark scheme 23
Cambridge Computer Science (9608) mark scheme for paper 23, Oct/Nov 2019 — 9608/23/O/N/19, file 9608_w19_ms_23.pdf.
Text of this paper
www.dynamicpapers.com
Cambridge Assessment International Education
Cambridge International Advanced Subsidiary and Advanced Level
COMPUTER SCIENCE
9608/23
Paper 2 Written Paper
October/November 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 October/November 2019 series for most
Cambridge IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level
components.
This document consists of 13 printed pages.
© UCLES 2019
[Turn over
9608/23
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
Generic Marking Principles
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).
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 2 of 13
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/23
Question
1(a)(i)
Answer
One mark for each (different) data type ...
... and one mark for a corresponding example value
Marks
6
Acceptable types: Integer, Real, String, Char, Boolean, Date,
1(a)(ii)
1(b)
Declaration
1
Two from (max 2):
2
•
•
•
1(c)(i)
1(c)(ii)
A list of identifier / variable names
Explanations/descriptions (of what they are used for)
Data types
One mark for each stage (Input, Output)
One mark for each correct example
Stage
Example statement
Input
Next = Console.Readline()
Process
x = INT(y/3)
Output
Console.Writeline("Goodbye")
One mark for statement in program code that includes (at least) two 'stages'
5
1
Example correct answers:
• Next = LEN(Console.Input())
• Console.writeline(Name & Address)
• Console.WriteLine(Console.Readline() & " is what you
entered")
1(d)
Three from the following (max 3):
•
•
•
•
•
•
1(e)
© UCLES 2019
3
Blank lines
Capitalisation of Keywords
Sensible variable names
Use of (library/built-in) functions
Comments
PrettyPrint / keywords coloured
White-box
1
Page 3 of 13
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/23
Question
Answer
Marks
2(a)(i)
•
•
Count-controlled // FOR loop
Used when the number of iterations is known / fixed
2
2(a)(ii)
REPEAT
CALL AlarmReset()
Status1 ← GetStatus(Sys_A)
Status2 ← GetStatus(Sys_B)
UNTIL (Status1 = TRUE AND Status2 = TRUE)
4
One mark for each of:
1
2
3
4
REPEAT ... UNTIL
Call to AlarmReset()
Asignment of Status1 and Status2
correct logical test
2(b)
2(c)
© UCLES 2019
Answer
Feature
The symbol used to indicate an assignment
:=
The line numbers for the start and end of a countcontrolled loop
180/190 and 230
The step value of the count-controlled loop
2
The character that indicates a comment
%
The name of a function
Mult // Read
Compiler / Interpreter
5
1
Page 4 of 13
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/23
Question
Answer
3
Marks
5
One mark for each of the following:
•
•
•
•
•
all three boxes correctly labelled
parameters in to GetPassword()
value back from GetPassword()
parameters in to UpdateFile()
BOOLEAN value back from UpdateFile()
Question
4(a)
Answer
One mark for each point.
3
Valid string must contain:
•
•
•
© UCLES 2019
Marks
at least one '.' characters
one '@' character
more than 5 other characters.
Page 5 of 13
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/23
Question
4(b)(i)
Answer
One mark for each area as outlined:
Index
4(b)(ii)
© UCLES 2019
Marks
NextChar
5
NumDots
NumAts
NumOthers
0
0
0
1
'J'
1
2
'i'
2
3
'm'
3
4
'.'
5
'9'
4
6
'9'
5
7
'@'
8
's'
6
9
'k'
7
10
'a'
8
11
'i'
9
12
'l'
10
13
'.'
14
'c'
11
15
'o'
12
16
'm'
13
1
1
2
TRUE
1
Page 6 of 13
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/23
Question
4(c)
Answer
One mark for string and one mark for correct explanation.
Same for second answer providing it results in a different path through the
algorithm.
Correct answers may be:
•
•
•
© UCLES 2019
without the correct number of '.'
without the correct number of '@'
without the correct number of 'other characters'
Page 7 of 13
Marks
4
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/23
Question
5
Answer
Marks
FUNCTION Abbreviate(Name : STRING) RETURNS STRING
8
DECLARE NewString : STRING
DECLARE NextChar : CHAR
DECLARE Index : INTEGER
DECLARE Space : BOOLEAN
CONSTANT SPACECHAR = ' '
Space ← TRUE
NewString ← ""
FOR Index ← 1 TO LENGTH(Name)
NextChar ← MID(Name,Index,1)
IF Space = TRUE
THEN
NewString ← NewString & NextChar // first char
of next word
Space ← FALSE
ELSE
IF NextChar = SPACECHAR
THEN
Space ← TRUE
ENDIF
ENDIF
ENDFOR
RETURN NewString
ENDFUNCTION
1 mark for each of the following (max 8):
1
2
3
4
5
6
7
8
Function header, ending and return parameters
Declare and Initialise NewString to either "" or first character of
name
FOR loop picking out all characters from Name:
extract an individual character in a loop
check for space character in a loop
concatenate the next character to NewString in a loop
Return NewString
Accommodate a string with trailing space
Question
6(a)(i)
Answer
One mark per underlined section:
DECLARE Result : ARRAY
© UCLES 2019
Marks
[0:99, 0:1]
Page 8 of 13
3
OF STRING
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/23
Question
6(a)(ii)
Answer
'Pseudocode' solution included here for development and clarification of
mark scheme.
Programming language example solutions appear in the Appendix.
FUNCTION FindBooksBy(SearchAuthor : STRING) RETURNS
INTEGER
DECLARE
DECLARE
DECLARE
DECLARE
DECLARE
Title : STRING
Author : STRING
Isbn : STRING
Location : STRING
Count : INTEGER
Count ← 0
OPENFILE "Library.txt" FOR READ
WHILE NOT EOF ("Library.txt")
READFILE
READFILE
READFILE
READFILE
"Library.txt",
"Library.txt",
"Library.txt",
"Library.txt",
Title
ThisAuthor
ISBN
Location
IF SearchAuthor = ThisAuthor
THEN
Result[Count, 0] ← Title
Result[Count, 1] ← Location
Count ← Count + 1
ENDIF
ENDWHILE
CLOSEFILE("Library.txt")
RETURN Count
ENDFUNCTION
One mark for each of the following:
1
2
3
4
5
6
7
8
© UCLES 2019
Function heading (and ending) including parameters
Declaration of variables used
Open file for reading (Allow Library or Library.txt)
WHILE loop checking for EOF():
Read all information 'fields', in the correct order, in a loop
If the author matches write Title and Location to Result array
in a loop
And increment array index in a loop // number found
Close file and RETURN Count
Page 9 of 13
Marks
8
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/23
Question
6(b)
Answer
Marks
PROCEDURE DisplayResults(Author:STRING, Count:INTEGER)
DECLARE Index, GLen : INTEGER
DECLARE Gap : STRING
Gap ← "
" // 25 spaces
IF Count = 0
THEN
OUTPUT "Search found no books by: " & Author
ELSE
OUTPUT "Books written by: " & Author
OUTPUT "Title" & LEFT(Gap, 20) & "Location"
FOR Index ← 1 TO Count
GLen ← 25 – LENGTH(Result[Index, 0])
OUTPUT Result[Index, 0] & LEFT(Gap, GLen) &
Result[Index, 1]
ENDFOR
OUTPUT "Number of titles found: " &
NUM_TO_STRING(Count)
ENDIF
ENDPROCEDURE
One mark for each of the following (max 7):
1
2
3
4
5
6
7
8
© UCLES 2019
Procedure heading and ending including parameters
Declaration of local INTEGER variable for use as index
Test if count = 0 and if so output suitable message including Author
for no books found otherwise output the two header strings (exact
format not important)
A FOR loop for Count times
... output two array elements from Result array in a loop
Final output statement
A reasonable attempt at calculating the number of spaces required to
align 'Location' column:
Alignment correct
Page 10 of 13
7
9608/23
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
Program Code Example Solutions
Q6 (a) (ii): Visual Basic
FUNCTION FindBooksBy(ByVal SearchAuthor As String) As Integer
Dim
Dim
Dim
Dim
Dim
Title As String
Author As String
Isbn As String
Location As String
Count As Integer
Count = 0
FileOpen(1, "Library.txt", OpenMode.Input)
While Not EOF(1)
Title = LineInput(1)
ThisAuthor = LineInput(1)
Isbn = LineInput(1)
Location = LineInput(1)
If SearchAuthor =
Result(Count,
Result(Count,
Count = Count
End If
End While
ThisAuthor Then
0) = Title
1) = Location
+ 1
FileClose(1)
Return Count
END FUNCTION
© UCLES 2019
Page 11 of 13
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/23
Q6 (a) (ii): Pascal
function FindBooksBy(SearchAuthor : string) : integer;
var
Title : string;
Author : string;
Isbn : string;
Location : string;
Count : integer;
MyFile : text;
begin
Count := 0;
assign(MyFile, 'Library.txt');
reset(MyFile);
while not EOF(MyFile) do
begin
readln(MyFile, Title);
readln(MyFile, ThisAuthor);
readln(MyFile, Isbn);
readln(MyFile, Location);
if SearchAuthor = ThisAuthor then
begin
Result[Count, 0] := Title;
Result[Count, 1] := Location;
Count := Count + 1;
end;
end;
close(MyFile);
FindBooksBy := Count;
end;
© UCLES 2019
Page 12 of 13
9608/23
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
Q6 (a) (ii): Python
def FindBooksBy(SearchAuthor):
##
##
##
##
##
Title : STRING
Author : STRING
Isbn : STRING
Location : STRING
Count : INTEGER
Count = 0
MyFile = open("Library.txt", 'r')
Title = MyFile.readline()
while Title != "":
ThisAuthor = MyFile.readline()
Isbn= MyFile.readline()
Location = MyFile.readline()
if SearchAuthor == ThisAuthor.strip():
Result[Count][0] = Title
Result[Count][1] = Location
Count = Count + 1
Title = MyFile.readline()
MyFile.close()
return(Count)
© UCLES 2019
Page 13 of 13