9608 Computer Science: MARK SCHEME For The May/June 2015 Series
9608 Computer Science: MARK SCHEME For The May/June 2015 Series
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 2015 series for most
Cambridge IGCSE®, Cambridge International A and AS Level components and some
Cambridge O Level components.
1 (a)
Identifier Data Type Description
Mark as follows:
(OUTPUT ) + INPUT x 2 (1 mark)
Two/three conditions in evidence correctly formed (1 mark)
(penalise Assignment used for equals)
Condition for penalty weight = 0 + assignment = 0 (1 mark)
Other conditions X 2 + Assignment of 4 and 8 (1 mark)
Final output of horse name + penalty weight (1 mark) [5]
(ii) 2
9 [2]
(b) (i)
Input
Output
value
Comment
Amount Fifty Twenty Ten
Dollar Dollar Dollar
85 (0 0 0) Error message
3 (i)
A Width in any order
B Length
C JobID
E JobCost
[5]
mark as follows:
identifier + data type × 3 (3 marks)
jobcost (only) BYREF (1 mark)
length, width (only) BYVALUE/BYREF (1 mark) [5]
Note: If no reference made to either Bank code or Dispenser code MAX 1 [max 2]
Visual Basic …
Console.WriteLine()
Console.Write("Which bank ..(Three digit code)? ")
ThisBank = Console.ReadLine
DispenserCount = 0
Do
DispenserRecord = LineInput(1)
DispenserCode = Left(DispenserRecord, 5)
Bank = Mid(DispenserRecord, 7, 3)
Console.WriteLine()
Console.WriteLine("There are " & DispenserCount & " dispensers
for this bank")
Python …
# DispenserLine – String
# DispenserCode - String
# Bank - String
# DispenserCount - Integer
# ThisBank - String
DispenserCount = 0
while 1:
DispenserLine = MyFile.readline()
if not DispenserLine:
break
DispenserCode = DispenserLine[0:5]
# slices chars 0,1,2,3,4
Bank = DispenserLine[6:9] # slices chars 6,7,8
if Bank == ThisBank:
DispenserCount = DispenserCount + 1
print(DispenserCode)
MyFile.close()
print
print("There are " + str(DispenserCount)
" dispensers for this bank")
Pascal …
begin
assign(TheFile, 'K:\DISPENSERS.txt') ;
reset(TheFile) ;
WriteLn() ;
Write('Which bank ..(Three digit code)? ') ;
Readln(ThisBank) ;
C
DispenserCount := 0 ;
repeat
readln(TheFile, DispenserRecord) ;
DispenserCode := Copy(DispenserRecord,1, 5) ;
Bank := copy(DispenserRecord, 7, 3) ;
Writeln(DispenserCode)
end ;
until EOF(TheFile) ;
close(TheFile) ;
writeLn() ;
writeLn('Dispenser count: ', DispenserCount) ;
readln ;
end.
• Accept: all data items are of the same data type (1 mark) [max 2]
(ii) 24 [1]
(iii) • The total number of amplifiers ‘produced’ by workers 1, 2 and 3/three workers
(1 mark)
• on day 2 (1 mark) [2]
(b)
WorkerTotal
1 0
2 0
3 0
1 1 10
2 21
3 31
4 45
2 1 20
2 36
3 60
4 80
3 1 9
2 20
3 33
4 50
1 2.25
2 2
3 1.25 INVESTIGATE 3
[8]
FOR WorkerNum ← 1 TO 3
WorkerTotal [WorkerNum] ← 0
ENDFOR
FOR WorkerNum ← 1 TO 3
FOR DayNum ← 1 TO 4
WorkerTotal[WorkerNum] ← WorkerTotal[WorkerNum] +
ProductionData[WorkerNum, DayNum]
ENDFOR
ENDFOR
FOR WorkerNum ← 1 TO 3
WorkerAverage = WorkerTotal[WorkerNum] / (4 *
DailyHoursWorked[WorkerNum]
IF WorkerAverage < 2
THEN
OUTPUT "Investigate" WorkerNum
ENDIF
ENDFOR
ENDPROCEDURE
Mark as follows:
All ‘3’s changed to NumWorkers
All ‘4’s changed to NumDays
WorkerAverage ‘4’ changed to NumDays [3]