Computing (9691) · May/June 2016 · Mark scheme 23
Cambridge Computing (9691) mark scheme for paper 23, May/June 2016 — 9691/23/M/J/16, file 9691_s16_ms_23.pdf.
More Computing (9691) papers
Other papers · May/June 2016
- Paper 13Question paperMark scheme
- Paper 21Question paperMark scheme
- Paper 22Question paperMark scheme
- Paper 33Question paperMark scheme
Paper 23 in other years
- Oct/Nov 2015O/N 2015Question 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
COMPUTING
9691/23
May/June 2016
Paper 2 Written Paper
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 will not enter into discussions about these mark schemes.
Cambridge is publishing the mark schemes for the May/June 2016 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.
This document consists of 8 printed pages.
© UCLES 2016
[Turn over
Page 2
1
Mark Scheme
Cambridge International AS/A Level – May/June 2016
(i)
Syllabus
9691
Paper
23
[2]
Identifier
Data type
Explanation
LowerTemp
INTEGER
Lower bound value of
Fahrenheit temperatures
UpperTemp
INTEGER
Upper bound value of
Fahrenheit temperatures
Interval
INTEGER
The interval between two
Fahrenheit temperatures
Fahrenheit
INTEGER
The Fahrenheit to be
converted
Result
REAL/FLOAT
Celsius
INTEGER
Value of conversion before
rounding
The rounded Result
Mark as follows:
5 × INTEGER
(1)
Result – REAL
(1)
(ii) INPUT LowerTemp
INPUT UpperTemp
INPUT Interval
OUTPUT "Conversion Table"
OUTPUT "Fahrenheit Celsius"
Fahrenheit ← LowerTemp
REPEAT
Result ← (Fahrenheit – 32) * 5 / 9
Celsius ← ROUND(Result)
OUTPUT Fahrenheit,"", Celsius
Fahrenheit ← Fahrenheit + Interval
UNTIL Fahrenheit > UpperTemp
Mark as follows:
– Fahrenheit ← LowerTemp
– (Fahrenheit – 32)
– * 5 / 9
– Celsius ← ROUND(Result)
– Fahrenheit ← Fahrenheit + Interval
– UNTIL Fahrenheit > UpperTemp
© Cambridge International Examinations 2016
[6]
Page 3
2
Mark Scheme
Cambridge International AS/A Level – May/June 2016
(a) Example Pascal
PROCEDURE VendingMachine;
VAR SnackType: CHAR;
VAR Price, CoinValue, Total: INTEGER;
BEGIN
ReadLn(SnackType);
CASE SnackType OF
'A': Price: =
'B': Price: =
'C': Price: =
'D': Price: =
END;
20;
40;
50;
80;
Total: = 0;
REPEAT
ReadLn(CoinValue);
Total:= Total + CoinValue;
UNTIL Total >= Price;
ChangeDue:= Total – Price;
IF ChangeDue > 0
THEN
OutputChange(ChangeDue)
ELSE
WriteLn("No Change");
END;
Mark as follows:
– Procedure heading & ending
– Local variables declared
– With correct data types
– Input SnackType
– Correct case statement
– Initialise Total
– REPEAT loop
– Input CoinValue and keep running total
– Calculate change due
– IF statement with procedure call to OutputChange()
– Output “No change”
© Cambridge International Examinations 2016
Syllabus
9691
Paper
23
Max [8]
Page 4
Mark Scheme
Cambridge International AS/A Level – May/June 2016
Syllabus
9691
Paper
23
(b) (i)
[4]
Statement
Value
Explanation
X ← ChangeDue DIV 50
X = 1
X represents the number of 50-cent
coins
Y ← ChangeDue MOD 50
Y = 30
Y represents the remaining change
due
(ii) Example Pascal
PROCEDURE OutputChange(ChangeDue: INTEGER);
VAR Coins, LeftOver : INTEGER;
BEGIN
Coins50: = ChangeDue DIV 50;
WriteLn("Number of 50c coins: ", Coins50);
LeftOver: = ChangeDue MOD 50;
Coins20: = LeftOver DIV 20;
WriteLn("Number of 20c coins:", Coins20);
LeftOver: = LeftOver MOD 20;
Coins10: = LeftOver DIV 10;
WriteLn("Number of 10c coins:", Coins10);
END;
Mark as follows:
– Procedure heading including parameter
– Number of 50-cent coins calculated
– Calculate ‘leftovers’ after 50 cents correctly
– Number of 20-cent coins calculated
– Calculate ‘leftovers’ after 20 cents correctly
– Number of 10-cent coins calculated
– Output all numbers of coins needed
© Cambridge International Examinations 2016
[7]
Page 5
3
(a)
Mark Scheme
Cambridge International AS/A Level – May/June 2016
Syllabus
9691
Paper
23
(i) PROCEDURE InputScoresAndCalcAverage(BYREF Average : REAL)
DECLARE x, TotalScore: INTEGER
TotalScore ← 0
FOR x ← 1 TO 10
OUTPUT "Score for", CompetitorName [x]
// input scores into the Score array
INPUT Score [x]
TotalScore ← TotalScore + Score [x]
ENDFOR
Average ← TotalScore / 10
ENDPROCEDURE
[7]
(ii) PROCEDURE UpdatePointsTotals(Average : REAL)
DECLARE i: INTEGER
FOR i ← TO 10
IF Score[i] > Average
THEN // increase PointsTotal
PointsTotal [i] ← PointsTotal [i] + 1
ELSE // below average?
IF Score [i] < Average
THEN
PointsTotal [i] ← PointsTotal [i] – 1
ENDIF
ENDIF
ENDFOR
ENDPROCEDURE
[8]
(iii) –
–
[2]
the address of Average gets passed
so that its value is returned to the calling program
© Cambridge International Examinations 2016
Page 6
Mark Scheme
Cambridge International AS/A Level – May/June 2016
Syllabus
9691
Paper
23
(b) (i)
x
[9]
NoMore
Swaps
PointsTota
l[x] <
PointsTota
l[x+1]
PointsTotal
Temp
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
+5
+3
+4
+2
0
+1
-2
-1
+4
+3
+1
0
-1
-2
[9]
-1
[10]
-3
TRUE
1
2
FALSE
FALSE
TRUE
+3
3
FALSE
4
FALSE
5
TRUE
6
FALSE
7
TRUE
-2
8
TRUE
-2
9
FALSE
0
-1
-2
TRUE
1
FALSE
2
FALSE
3
FALSE
4
FALSE
5
FALSE
6
FALSE
7
FALSE
8
FALSE
9
FALSE
(ii) –
–
when sorting the table
only swapped the points total, not the name or the score
© Cambridge International Examinations 2016
[2]
Page 7
Mark Scheme
Cambridge International AS/A Level – May/June 2016
Syllabus
9691
(c) (i) Example Pascal
TYPE CompetitorRecord = RECORD
CompetitorName: STRING[20];
CompetitorTelNumber: STRING[15];
DateOfBirth: TDATETIME;
GameScores: ARRAY[1..8] OF INTEGER;
PointsTotal: INTEGER;
END;
Paper
23
Max [5]
Mark as follows:
– record header & ending
– CompetitorName, CompetitorTelNumber
– DateOfBirth
– GameScores … INTEGER
– ARRAY[1..8]
– PointsTotal
(ii) Example Pascal
VAR CompetitorData: ARRAY[1..10] OF CompetitorRecord
[3]
Mark as follows:
– array name declaration
– array dimension
– data type
(d) FUNCTION FindCompetitorRank(SearchName: STRING) RETURNS INTEGER
DECLARE i : INTEGER
i ← 0
REPEAT
i ← i + 1
UNTIL CompetitorData [i].CompetitorName = SearchName
RETURN i
ENDFUNCTION
© Cambridge International Examinations 2016
[7]
Page 8
Mark Scheme
Cambridge International AS/A Level – May/June 2016
(e) Example Pascal
PROCEDURE SaveToFile;
BEGIN
VAR CompFile: FILE OF CompetitorRecord;
VAR i: INTEGER;
ASSIGNFILE (CompFile, 'CompetitorFile.DAT';
REWRITE (CompFile);
FOR i: = 1 TO 10 DO
WRITE(CompFile, CompetitorData[i]);
CLOSEFILE(CompFile);
END;
Mark as follows:
– Procedure heading and ending
– Declaration of local variables
– Assigning a file name
– Open file for writing
– Nested loop to access each array element
– Write element out to file
– Close file
© Cambridge International Examinations 2016
Syllabus
9691
Paper
23
Max [5]