Cambridge Assessment International Education: Computer Science 9608/21 May/June 2018
Cambridge Assessment International Education: Computer Science 9608/21 May/June 2018
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.
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.
• 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.
Marks awarded are always whole marks (not half marks, or other fractions).
• 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.
Rules must be applied consistently e.g. in situations where candidates have not followed
instructions or in the application of generic level descriptors.
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).
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.
Items 1 and 2 must have suitable prefix / suffix (i.e. not just 'temp')
2(a)(i) • Indentation 4
• Blank lines / white space
• Capitalisation of keywords
• Meaningful identifier names
2(a)(ii) • Comments 1
Question
Q Answerr Mark
ks
3 8
Question
Q Answerr Mark
ks
3 ALTERNA
ATIVE SOLU
UTION USIN
NG 'CASE' 8
Mark as fo
ollows:
1 One mark
m for STA ART and EN ND / STOP P
2 One mark
m for pro
ompt and inp put of Sens
sorID (allow
w alt name))
3 One mark
m for dec
cision box cchecking thaat SensorI
ID is betweeen 1 & 10
4 One mark
m for calling GetTem mp with SennsorID as parameter
5 One mark
m for dec
cision box CCASE Temp p
6 One mark
m for calling Alarm ()
7 One mark
m for two
o correct CAASE conditio
ons
8 One mark
m for botth output meessages
4(a) Features: 3
4(b) ItemProcess
6
InString InString
RetFlag
AddToList RemoveFromList
Mark as follows:
One mark for top box
One mark for both lower boxes
One mark for diamond 'decision' symbol
One mark for each parameter (3 parameters)
5(a) Details are saved after the program ends // after the computer is switched off 1
• Context-sensitive help
• Syntax checking (on entry)
• Automatic indentation
• Type checking (Parameter checking)
• PrettyPrinting
• Highlight structure blocks (e.g. selection, iteration)
• Highlight any undeclared variables
• Highlight any unassigned variables
5(c) 'Pseudocode' solution included here for development and clarification of mark 9
scheme.
Programming language solutions appear in the Appendix.
PROCEDURE AddNewScores()
ENDWHILE
CLOSEFILE("ScoreDetails.txt")
ENDPROCEDURE
BurnFlag ← FALSE
FOR i ← 1 TO 8
FOR j ← 1 TO 8
OldPixelValue ← Picture[i, j]
PixelTemp ← OldPixelValue * 1.1
NewPixelValue ← INT(PixelTemp)
IF NewPixelValue >= 255
THEN
NewPixelValue ← 255
BurnFlag ← TRUE
ENDIF
Picture[i, j] ← NewPixelValue
ENDFOR
ENDFOR
RETURN BurnFlag
ENDFUNCTION
7 'Pseudocode' solution included here for development and clarification of mark Max7
scheme.
Programming language solutions appear in the Appendix.
Total ← 0
Highest ← Mark[1] //The highest mark is the first one
Position ← 1
FOR i ← 1 to 20
Total ← Total + Mark[i]
IF Mark[i] > Highest
THEN
Highest ← Mark[i]
Position ← i
ENDIF
ENDFOR
Average ← Total/20
Output ("The average mark is " & Average & " and the
highest mark is " & Highest)
RETURN Position
ENDFUNCTION
*** End of Mark Scheme – example program code solutions follow ***
Appendix
Q5(c)
Visual Basic
Sub AddNewScores()
Loop
FileHandle.Close()
End Sub
Python
def AddNewScores():
#ScoreDate as string
#MembershipNumber as string
#Score as integer
#FileHandle as text file
Pascal
procedure AddNewScores;
var FileData, ScoreDate, MembershipNumber: String;
Score: Integer
MyFile: text;
begin
assign(MyFile,'ScoreDetails.txt');
append(MyFile);
writeln('Input the date for the scores');
readln(ScoreDate);
writeln('Input the Membership number');
readln(MembershipNumber);
Q7
Visual Basic
Total = 0
Position = 1
Highest = Mark(1)
For i = 1 To 20
Total = Total + Mark(i)
If Mark(i) > Highest Then
Highest = Mark(i)
Position = i
End If
Next
Average = Total / 20
Console.WriteLine ("The average mark is " & Average & _
" and the highest mark is " & Highest)
Return Position
End Function
Python
highest = mark[0]
total = 0
position = 0
for i in range(0,20):
total = total + mark[i]
if mark[i] > highest:
highest = mark[i]
position = i
average = total/20
print('The average mark is ' + str(average) + \
' and the highest mark is ' + str(highest))
return position
Pascal
begin
highest := mark[1];
total := 0;
position := mark[1];
for i := 1 to 20 do
begin
total := total + mark[1];
if mark[i] > highest then
begin
highest := mark[i];
position := i;
end;
end;
average := total / 20;
writeln ('The average mark is ', average, ' and the highest mark is ',
highest);
ProcessMarks := position;
end;