Computing (9691) · Oct/Nov 2015 · Mark scheme 21
Cambridge Computing (9691) mark scheme for paper 21, Oct/Nov 2015 — 9691/21/O/N/15, file 9691_w15_ms_21.pdf.
More Computing (9691) papers
Other papers · Oct/Nov 2015
- Paper 11Question paperMark scheme
- Paper 22Question paperMark scheme
- Paper 23Question paperMark scheme
- Paper 31Question paperMark scheme
Paper 21 in other years
- May/June 2016M/J 2016Question paperMark scheme
- May/June 2015M/J 2015Question paperMark scheme
- Oct/Nov 2014O/N 2014Question paperMark scheme
- May/June 2014M/J 2014Question paperMark scheme
- Oct/Nov 2013O/N 2013Question paperMark scheme
- May/June 2013M/J 2013Question paperMark scheme
- Oct/Nov 2012O/N 2012Question paperMark scheme
- May/June 2012M/J 2012Question paperMark scheme
Text of this paper
CAMBRIDGE INTERNATIONAL EXAMINATIONS
Cambridge International Advanced Subsidiary and Advanced Level
MARK SCHEME for the October/November 2015 series
9691 COMPUTING
9691/21
Paper 2 (Written Paper), maximum raw mark 75
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 will not enter into discussions about these mark schemes.
Cambridge is publishing the mark schemes for the October/November 2015 series for most
Cambridge IGCSE®, Cambridge International A and AS Level components and some
Cambridge O Level components.
® IGCSE is the registered trademark of Cambridge International Examinations.
Page 2
1
Mark Scheme
Cambridge International AS/A Level – October/November 2015
Syllabus
9691
Paper
21
(a)
Field
course
code
title
Identifier
Data type
CourseCode
STRING
(not text/alphanumeric)
Title
STRING
(not text/alphanumeric)
Example of
input data
Field
size
(in
bytes)
015110217
10
(approx.)
(accept
a range)
Programming
for Beginners
30
(approx.)
(accept
a range)
marks
1
1
tutor
(3-letter
initials)
Tutor
STRING
(not text/alphanumeric)
day of
week
Day
BYTE / INTEGER
Accept CHAR/STRING(1)
lab based?
IsLabBased
BOOLEAN
session
duration in
hours
SessionHours
REAL/FLOAT/SINGLE
fee ($)
CourseFee
CURRENCY/FLOAT/DECIMAL
SINGLE/REAL/DOUBLE
date
course
starts
StartDate
DATE/REAL (STRING)
PGL
3/6
2
1/4
1/2
1
TRUE
1/2
1
2.5
4/8
1
25.50
8 / 16
1
03/11/2015
8 (10)
1
date
course
ends
EndDate
DATE/REAL (STRING)
03/12/2015
8 (10)
[max 5]
© Cambridge International Examinations 2015
Page 3
Mark Scheme
Cambridge International AS/A Level – October/November 2015
Syllabus
9691
Paper
21
(b) Mark as follows:
1 mark for correct record header
1 mark for correct definition terminator
1 mark for the first 5 fields defined correctly for language
1 mark for the remaining 4 fields defined correctly for language
Do not accept pseudocode
Field names must be as given, but ignore capitalisation/spaces
Declared program language must match code given
Ignore field sizes and data type
If misused DIM in VB, penalise once
If statement separators missing, penalise once
Example Pascal
TYPE CourseRecordType = RECORD
CourseCode: STRING[10];
Title: STRING[30];
Tutor: STRING[3];
Day: BYTE;
IsLabBased: Boolean;
SessionHours: REAL;
CourseFee: Currency;
StartDate: TDateTime;
EndDate: TDateTime;
END;
[4]
(c) Note that some candidates may already have done this in part (b). In that case, give marks
according to part (b).
VAR Course : ARRAY[1..50] OF CourseRecordType
VAR DummyRecord : CourseRecordType
WITH DummyRecord DO
BEGIN
CourseCode :='';
Title := '';
Tutor := '';
Day := 0;
IsLabBased := FALSE;
SessionHours := 0;
CourseFee := 0;
StartDate:= 01/01/2010
EndDate := 01/01/2010
END;
FOR i := 1 to 50 DO
Course[i] := DummyRecord;
© Cambridge International Examinations 2015
[2]
[1]
[1]
[1]
[1]
[1]
Page 4
Mark Scheme
Cambridge International AS/A Level – October/November 2015
Alternative:
VAR Course : ARRAY[1..50] OF CourseRecordType
FOR i := 1 to 50 DO
BEGIN
Course[i].CourseCode :='';
Course[i].Title := '';
Course[i].Tutor := '';
Course[i].Day := 0;
Course[i].IsLabBased := FALSE;
Course[i].SessionHours := 0;
Course[i].Course Fee := 0;
Course[i].StartDate:= 0;
Course[i].EndDate := 0;
END;
[1]
Syllabus
9691
Paper
21
[2]
[1]
[1]
[1]
[1]
[max 6]
Do not penalise again for incorrect data type
(d) (i) –
–
EOF() returns TRUE or FALSE
depending on whether it found the marker at the end of the file
[2]
(ii) Mark as follows:
– Open file CourseData.DAT
– … for reading/input
–
–
–
–
–
loop while not end of file CourseData.DAT
read record from file
assign to array element
correctly initialised and incremented index
Close file CourseData.DAT
Example pseudocode:
OPENFILE CourseData.DAT for READING // for INPUT
i ← 1
WHILE NOT EOF(CourseData.DAT)
READ record FROM FILE
Course[i] ← record
i ← i + 1
ENDWHILE
CLOSEFILE CourseData.DAT
© Cambridge International Examinations 2015
[max 6]
Page 5
Mark Scheme
Cambridge International AS/A Level – October/November 2015
Syllabus
9691
Paper
21
(e) Mark as follows:
– change outer FOR loop to a REPEAT/WHILE loop
– decrementing the iterations of the FOR loop
– introduce a Boolean variable NoSwaps (or similar)
– initialise Boolean variable correctly (inside outer loop and outside inner loop)
– terminate REPEAT loop when no swaps made
– leave comparison and swapping code the same
– change upper limit of inner loop to NumberOfCourses – x (instead of 49)
Example pseudocode:
PROCEDURE SortData(NumberOfCourses)
x ← 0
// NoSwaps ← FALSE
(required for WHILE loop)
REPEAT // WHILE NoSwaps = FALSE
x ← x + 1
NoSwaps ← TRUE
FOR y ← 1 TO NumberOfCourses - x
IF Course[y].CourseFee > Course[y + 1].CourseFee
THEN
NoSwaps ← FALSE
TempRecord ← Course[y]
Course[y] ← Course[y + 1]
Course[y + 1] ← TempRecord
ENDIF
ENDFOR
UNTIL NoSwaps = TRUE
// ENDWHILE
ENDPROCEDURE
© Cambridge International Examinations 2015
[max 6]
Page 6
2
Mark Scheme
Cambridge International AS/A Level – October/November 2015
Syllabus
9691
Paper
21
(a) (i) Mark as follows:
– parameter
– Return data type
– Correctly formed CASE statement (including the end)
– with all cases present (characters in quotes)
– ELSE clause
– Return of value (implied)
Example PASCAL
FUNCTION DenaryDigit(Letter :
BEGIN
CASE Letter OF
'K': DenaryDigit :=
'D': DenaryDigit :=
'L': DenaryDigit :=
'C': DenaryDigit :=
'F': DenaryDigit :=
'H': DenaryDigit :=
'B': DenaryDigit :=
'G': DenaryDigit :=
'E': DenaryDigit :=
'A': DenaryDigit :=
ELSE
DenaryDigit:= -1
END;
END;
CHAR) : INTEGER;
0;
1;
2;
3;
4;
5;
6;
7;
8;
9;
[max 5]
(ii)
Letter
Expected result
Type of data
(normal, borderline or invalid)
'1'
–1
Invalid (digit)
'X'
–1
Invalid (letter)
'G'
7
normal
1 mark per row
[3]
© Cambridge International Examinations 2015
Page 7
Mark Scheme
Cambridge International AS/A Level – October/November 2015
Syllabus
9691
Paper
21
(b) (i) Mark as follows:
1 mark per column (2 to 6)
if zero marks then mark by row
CodedNumber Denary
"LED"
i
ThisChar
ThisNumber OUTPUT
20
1
L
2
100
2
E
8
110
3
D
1
0
110
[5]
(ii) line number 08
Denary ← Denary * 10 + ThisNumber
[2]
Do not accept concatenation of separate digits (unless they are CHAR/STRING)
(iii) logic error
[1]
(iv) Second and third mark dependent on first mark.
When and how interchangeable
Type: – syntax error
When: – during compilation of program // in IDE environment // running an interpreted
program
How: – reported by the translator diagnostics // highlights/stops at the statement with the
syntax error // compiler/interpreter checks against syntax rules / rules of the language
Type: – run-time error
When: – during testing/execution
How: – program will ‘crash’ e.g. attempted ‘divide by zero’ error
[6]
© Cambridge International Examinations 2015
Page 8
Mark Scheme
Cambridge International AS/A Level – October/November 2015
(c) (i) –
–
–
–
–
–
Syllabus
9691
Meaningful variable names
Capitalisation of keywords
Empty lines
Use of indentation
Initialisation (of variables)
Use of (library/built-in) functions
Paper
21
[max 3]
Do not accept white space / camel case on its own.
(ii) Comments/annotations/remarks
[1]
(iii) 1 mark per line of pseudocode correctly written in the high-level language chosen.
1 mark for declarations:
Example Pascal:
PROCEDURE ConvertToDenary(CodedNumber: STRING);
VAR Denary, ThisNumber, i : INTEGER;
ThisChar : CHAR;
//
[1]
//
[1]
BEGIN
Denary := 0;
//
[1]
//
[1]
//
//
//
[1]
[1]
[1]
//
[1]
//
//
[1]
[1]
FOR i := 1 TO LENGTH(CodedNumber)DO
BEGIN
ThisChar := MIDSTR(CodedNumber, i, 1);
ThisNumber := DenaryDigit(ThisChar);
Denary := Denary + ThisNumber * 10;
Accept 'corrected version'
END;
WriteLn(Denary);
END;
[10]
(iv) –
–
–
–
IF ThisNumber = – 1 THEN
output statement giving the error message
instead of OUTPUT Denary
exit from the loop
© Cambridge International Examinations 2015
[3]
Page 9
3
Mark Scheme
Cambridge International AS/A Level – October/November 2015
Syllabus
9691
Paper
21
(a) Give credit for answers to “why” rather than “how”.
(i) Set a breakpoint in the program code
Execution will pause at this point
(ii) Stepping allows one statement to be executed at a time
The program execution pauses after each statement
Often used from a set breakpoint
Can use variable watch at each step
Stepping over to skip statements
(iii) Variable watch allows tester to see the current contents of a variable
// Used to see how variable contents change when stepping through program
Tester chooses variables to watch
(b) White-box
[2]
[Max 2]
[2]
[1]
© Cambridge International Examinations 2015