Computer Science (9608) · Oct/Nov 2019 · Mark scheme 22
Cambridge Computer Science (9608) mark scheme for paper 22, Oct/Nov 2019 — 9608/22/O/N/19, file 9608_w19_ms_22.pdf.
Text of this paper
www.dynamicpapers.com
Cambridge Assessment International Education
Cambridge International Advanced Subsidiary and Advanced Level
COMPUTER SCIENCE
9608/22
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/22
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/22
Question
1(a)(i)
Answer
Marks
Any three from:
1.
2.
3.
4.
3
Indentation
Blank lines / white space
Sensible identifier names / use of Camel Case for identifier names
Capitalised keywords
1(a)(ii)
5
START
Mark as follows:
• One mark for START and END
• One mark for each of the 4
areas outlined
Tries ← 1
Full ←
ReadSensor("F1")
YES
Is Full =
TRUE?
Loop must be included for
this area mark
NO
Is NOT Full
AND Tries < 4
NO
YES
Is
Tries > 3?
Call TopUp()
NO
YES
Full ←
ReadSensor("F1")
Output
"Too many attempts"
Tries ← Tries + 1
Output
"Tank now full"
Output
"Already Full"
END
© UCLES 2019
Page 3 of 13
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/22
Question
1(b)(i)
Answer
One mark per row
4
Example value
1(b)(ii)
Data type
43
INTEGER
TRUE
BOOLEAN
−273.16
REAL
"−273.16"
STRING
One mark per row
4
Expression
Evaluates to
RIGHT("Stop", 3) & LEFT("ich",2)
MID(NUM_TO_STRING(2019), 3, 1)
INT(NUM_TO_STRING(-273.16))
Question
"topic"
"1"
ERROR
6
INT(13/2)
2(a)
Marks
Answer
One mark per point:
1.
2.
3.
Marks
3
The source code represents a solution / design / algorithm expressed in a
high-level language
The Object code is produced (by the compiler) during the translation stage
// The Object code is produced by translating the source code (NOT
produced by Interpreter)
Corrective maintenance occurs when testing reveals a fault (or error) in the
program and this is corrected // Corrective maintenance is when errors are
found and fixed // Corrective maintenance is when a program is debugged
Accept alternative answers provided they relate to the program development
cycle
2(b)
Any three from:
1.
2.
3.
4.
5.
6.
© UCLES 2019
3
Dynamic syntax checking // Identification of syntax errors
Highlighting undeclared variables // incorrect variable usage...
Parameter checking
Type checking
Auto-indentation
PrettyPrint
Page 4 of 13
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/22
Question
3(a)
Answer
DECLARE Result : ARRAY [0:9] OF INTEGER
DECLARE Index : INTEGER
Marks
3
FOR Index ← 0 TO 9
Result[Index] ← 0
ENDFOR
One mark for each of the following:
1.
2.
3.
3(b)
Declaration of RESULT array (10 elements of type INTEGER)
Loop
Assignment within a loop
DECLARE Index : INTEGER
DECLARE NextChar : CHAR
DECLARE NextCharValue : INTEGER
FOR Index ← 1 TO LENGTH(InString)
NextChar ← MID(InString, Index, 1)
NextCharValue ← STRING_TO_NUM(NextChar)
Result[NextCharValue] ← Result[NextCharValue] + 1
ENDFOR
FOR Index ← 0 TO 9
OUTPUT "Count of digit " & NUM_TO_STRING(Index) & " : "
& NUM_TO_STRING(Result[Index])
ENDFOR
One mark for each of the following:
1.
2.
3.
4.
5.
6.
7.
8.
© UCLES 2019
Declaration of INTEGER variable for Index (or equivalent) to index
Result array
First loop from 1 to length of InString:
Select each character (e.g MID) in first loop
Apply type conversion to obtain integer value for index in first loop
Increment element of Result array in a loop
Separate second loop to repeat 10 times:
Attempt to OUTPUT two items (digit 0 to 9 plus corresponding count) in
any loop
OUTPUT statement including index and count in any loop including type
conversion of element from array if required in a loop
Page 5 of 13
8
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/22
Question
4(a)
Answer
PROCEDURE Button(ButtonNum : INTEGER)
DECLARE Limit : INTEGER
Marks
6
IF ButtonNum = 10 // increase volume
THEN
IF MaxVol = 0
THEN
Limit ← 49
ELSE
Limit ← MaxVol
ENDIF
IF VolLevel < Limit
THEN
VolLevel ← VolLevel + 1
ENDIF
ELSE // otherwise must be ButtonNum 20 - decrease
IF VolLevel > 0
THEN
VolLevel ← VolLevel - 1
ENDIF
ENDIF
ENDPROCEDURE
Mark as follows:
1.
2.
3.
4.
Check if parameter value = 10
Check if parameter value = 20
Check if MaxVol = 0
Decrement VolLevel and ensure still in range
If attempting to increase volume (parameter value was 10):
5.
6.
4(b)
Increment VolLevel
Ensure VolLevel still in range: for both cases. i.e:
VolLevel <= 49 (for MaxVol = 0)
VolLevel <= MaxVol (for MaxVol <> 0)
2 independent marks for each test:
Test 1
MaxVol: 0/49
VolLevel expected: 49
Test 2
VolLevel before: 34
VolLevel expected: 34
Test 3
Parameter: 20
VolLevel expected: 0
© UCLES 2019
Page 6 of 13
6
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/22
Question
4(c)(i)
Answer
One mark for type, one for description:
•
•
•
•
4(c)(ii)
•
3
Tests carried out before all the modules / subroutines have been written
Simple / dummy module written to simulate / model / replace the actual
module / subroutine / object
Contains an output statement // returns a fixed value to indicate that the call
has been made
Question
Answer
5
Marks
7
One mark for each of:
1.
2.
3.
4.
5.
6.
7.
© UCLES 2019
2
Type: Logical Error
Description: Program does not perform as expected
Type: Run-time error
Description: Program executes an invalid instruction / out of bounds error /
attempts to divide by zero // program crashes
One mark per bullet point:
•
•
Marks
Diagram with boxes as above correctly labelled
P3 and S2
Return Boolean from Validate()
P4
M4
T4
Return parameter from Update()
Page 7 of 13
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/22
Question
6(a)
Answer
'Pseudocode' solution included here for development and clarification of mark
scheme.
Programming language example solutions appear in the Appendix.
FUNCTION SearchLeavers(Reference : STRING) RETURNS BOOLEAN
DECLARE Index : INTEGER
DECLARE Found : BOOLEAN
Found ← FALSE
Index ← 0
WHILE Index < 500 AND NOT Found
IF Reference = Leavers[Index]
THEN
Found ← TRUE
ENDIF
Index ← Index + 1
ENDWHILE
RETURN Found
ENDFUNCTION
One mark for each of the following:
1.
2.
3.
4.
5.
6.
© UCLES 2019
Function heading (and ending) as above
Initialisation and increment of Index used to index Leavers array in a
loop
Conditional loop repeating while Index < 500 and exit loop if
Reference is found:
Compare indexed array element value with Reference in a loop
Set termination logic if found in a loop
Return Boolean value
Page 8 of 13
Marks
6
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/22
Question
6(b)
Answer
FUNCTION ProcessStudentList() RETURNS INTEGER
DECLARE NotCopied : INTEGER
DECLARE FileData : STRING
DECLARE Reference : STRING
NotCopied ← 0
OPENFILE "StudentList.txt" FOR READ
OPENFILE "UpdatedList.txt" FOR WRITE
WHILE NOT EOF("StudentList.txt")
READFILE "StudentList.txt", FileData
IF MID(FileData, 6, 1) = '*'
THEN
Reference ← MID(FileData, 1, 5) // five char
reference
ELSE
Reference ← MID(FileData, 1, 8) // eight char
reference
ENDIF
IF SearchLeavers(Reference) = FALSE
THEN
WriteFile "UpdatedList.txt", FileData
ELSE
NotCopied ← NotCopied + 1
ENDIF
ENDWHILE
CLOSEFILE "StudentList.txt"
CLOSEFILE "UpdatedList.txt"
RETURN NotCopied
ENDFUNCTION
One mark for each of the following:
1.
2.
3.
4.
5.
6.
7.
8.
9.
© UCLES 2019
Function heading and ending as above
Declaration and use of three local variables and initialisation of count to 0
OPEN both files in correct mode and CLOSE
Pre-Condition loop to go through the file StudentList.txt until EOF()
Read line from StudentList.txt and extract correct Reference (either
5 or 8 characters) in a loop
Call SearchLeavers() with Reference (after attempted extraction) in a
loop
If result is FALSE then write FileData to UpdatedList.txt in a loop
Otherwise increment NotCopied in a loop
Return NotCopied count
Page 9 of 13
Marks
9
9608/22
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
Question
6(c)
Answer
'Pseudocode' solution included here for development and clarification of mark
scheme.
Programming language example solutions appear in the Appendix.
One mark per underlined section:
Result ← CountTimes (Leavers, "")
(Space before open bracket to highlight underlined section only)
© UCLES 2019
Page 10 of 13
Marks
3
9608/22
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
Program Code Example Solutions
Q6 (a): Visual Basic
Function SearchLeavers(ByVal Reference As String) As Boolean
Dim Index As Integer
Dim Found As Boolean
Found = FALSE
Index = 0
Do While Index < 500 And Not Found
If Reference = Leavers(Index) Then
Found = TRUE
End If
Index = Index + 1
Loop
Return Found
End Function
© UCLES 2019
Page 11 of 13
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
9608/22
Q6 (a): Pascal
function SearchLeavers(Reference : String) : boolean;
var Index : integer;
var Found : boolean;
begin
Found := FALSE;
Index := 0;
While Index < 500 And Not Found
begin
if Reference = Leavers[Index] Then
Found := TRUE;
Index := Index + 1;
end;
result := Found; // SearchLeavers := Found
end;
Q6 (a): Python
def SearchLeavers(Reference):
## Index : Integer
## Found : Boolean
Found = False
Index = 0
while Index < 500 and not Found:
if Reference == Leavers[Index]:
Found = True
Index = Index + 1
return Found
© UCLES 2019
Page 12 of 13
9608/22
Cambridge International AS/A Levelwww.dynamicpapers.com
– Mark Scheme
October/November
2019
PUBLISHED
Q6 (c): Visual Basic
Result = CountTimes(Leavers, "")
Q6 (c): Pascal
Result := CountTimes(Leavers, "");
Q6 (c): Python
Result = CountTimes(Leavers, "")
© UCLES 2019
Page 13 of 13