Professional Documents
Culture Documents
Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level
Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level
Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level
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.
1 MyScore = 65
2 FOR IndexVal = 0 TO 99
3 MyArray[3] = ID(MyString,3,2)
1 Assign 65 to MyScore
(Start of) loop with loop counter starting from zero & going to 99 /
2
repeating 100 times
3 Assign 2 chars from position 3/4 in MyString to MyArray element 3/4
4 Test if MyScore is greater than or equal to 70
Marks the end of WHILE / precondition loop //Return to top of loop to
5
check condition
6 If a condition is FALSE, variable Message is assigned the value "ERROR"
Temperature
REAL / FLOAT / Temperature value calculated
SINGLE / DOUBLE from sensor value
Qu
Q ues
stio
on An
nsw
wer Mar
M rks
s
(b) Max
M x6
A rm
Ala mState ← FA
ALS
SE 1
INPUT ThresholdValue
INPUT SensorV
Value 2
Tem
mperature ← Sen
S nso
orV
Val
lue
e * 1.1
1 135
5 3
lar
Al rmS
Sta
ate
e ← T
TRU
UE
5
OU
UTP
PUT
T "Te
" emp
per
rat
tur
re Al
lar
rm"
"
4 LSE
EL E
OU
UTP
PUT
T "Te
" emp
per
rat
tur
re OK
K" 6
Al
lar
rmS
Sta
ate
e ← FA
ALS
SE 7
ENDIF
Mark
k poin
p nts ass ciirclled
d, des
d scriptions as
a below
w:
1. Seettin
ng Al lar State tto FA
rmS F LSE (Co
( ond d. che
c eck
k not essentiaal b
butt mus
m st be
b ccorrrect if
pre
ese entt)
2. puttting S
Inp SennsorrVaal an nd ThhreeshholldVaal
3. Coorreectt va
alue
e ass
a signned
d to
o Tem
T mpeeratur ( ustt be * not x)
re (m
4. IFF...TH HENN..ELS SE...EENDDIF stru
s uctture
e with
w h co ct condition
orrrec n (o
or two
t o se
eparaate
e IF
F
cla
aussess)
5. Coorreectt TH
HENN staatemeentts as
a sho
s ow
wn
6. Coorreectt EL
LSEE stat
s temment as sh howwn
7. Seettin
ng Al lar State tto FA
rmS F LSE wit
w thinn ELS
SE cla
c aus o ly if m
se on maark pooin
nt 1 not
giv
ven n
© Ca
amb
brid
dge
e In
nterrnattion
nal Ex
xam
mina
atio
ons
s 20
016
6
Page 5 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – May/June 2016 9608 22
ENDFOR
ENDFUNCTION
OR
Lookup = []
For i in range(128) :
Lookup.append("")
Mark as follows:
VB / Pascal: one mark per part-statement as underlined and bold
Python:
One mark for Lookup and []
One mark for range(128)
Ques
Qu stio
on An
nsw
wer Mar
M rks
s
(ii) 'P
Pseudocode' ssollutiion
n inclu
ude
ed here forr de
eveelo
opm
mennt and
a d clar
c rificcattion
n of mar
m rk 6
scche
emee.
Prrog
gramm min
ng lan
ngu
uag ge solution
ns app
a pea ar in the
t e App
A penndix
x.
IN
NPU
UT St
tar
rtP
Pos
s 1
IN
NPU
UT Nu
umT
ToC
Cha
ang
ge
FO
OR n ← 0 to
o Num
N mTo
oCh
han
nge
e - 1
OUT
O TPU
UT " In
npu
ut ne
ew va ue fo
alu or po
osi
ition
n " 3
2
INP
I PUT
T New
N wCh
har
r 4
Loo
L oku
up[St
tar
rtP
Pos n] ← Ne
s + n ewC
Cha
ar 5
EN
NDF
FOR
R
UPU
OU UT (N
Num
mTo
oCh
han
nge
e & " ent
e tri
ies c
cha
ang d") 6
ged
AL
LTE
ER
RNA
ATIV
VEE:
IN
NPU
UT St
tar
rtP
Pos
s 1
IN
NPU
UT Nu
umT
ToC
Cha
ang
ge
n ← 0
RE
EPE
EAT
T
OUT
O TPU
UT " In
npu
ut ne
ew va ue fo
alu or po ition
osi n " 3
2 INP
I PUT
T New
N wCh
har
r 4
Loo
L oku
up[St
tar
rtP
Pos
s + nn] ← Ne
ewC ar 5
Cha
n ← n + 1
UN
NTI
IL n = Nu
umT
ToC
Cha
ang
ge
OU
UTP
PUT
T (Nu
umT
ToC
Cha ge & " en
ang ntr es ch
rie han ed") 6
nge
Mark
k poin
p nts ass ciirclled
d, des
d scriptions as
a below
w:
1. Tw
wo INNPUUT staateme entts
2. Woork
king
g lo
oopp (u
usiing
g va
alues off n fro om flo
owcchaart))
3. OU
UTPPUTTpprommppt (exaactt te
ext noot spe
s eciffied
d)
4. IN
NPUUT NeewCChaar
5. As
ssig
gnmmeent of NeewCChaar to co orreect arrrayy elem
e me ent
6. OU
UTPPUTT fina
al mes
m ssa agee affter lo
oopp (eexa
actt te
ext noot specifiied
d bu
ut mu
ust inc
clu
ude
e
Nu
umTToCChaange orr looopp coounnte
er iff va
alue cor
c rrec ct a
at tha
t at poin
p nt)
4 (a)) • Pro
ogramm ccod de is eas
e sie
er to
o im
mpplem meent / ma
m nage Max
M x2
• Moodu
ules m may beb givven
n to
o diffe
erent peop ple to de
evelop
p // giv
ven
n to
o pro
p gra
amm
specialiistss
• ogram
Pro m ccod de is eas
e sie
er to
o te
estt / de
d bug / main ntain
• En
ncoouraage es the
e re-u
usa
ability
y off prrog
gram code
© Ca
amb
brid
dge
e In
nterrnattion
nal Ex
xam
mina
atio
ons
s 20
016
6
Pag
P ge 7 Mar
M k Sch
S hemme
e Sylllab
S bus Pape
er
C mb
Cambrid
dge Inte
ern
nattional AS/
A /A Le
eve
el – May
M y/Ju
une 201
2 16 9 08
960 2
22
Ques
Qu stio
on An
nsw
wer Mar
M rks
s
(b) (i) 3
(ii) A (orr B)
B – Card
C d deta
d ails s / Ca
ard nu ummbeer / Ca
ardd in
nfo 3
B (orr A)
A – Cos
C st detaails
s / am
amou untt pa
aya
ablee / prrod
duc
ct ccostt / tot
t al billl
C – (F
Fla
ag) ind
dic
catoor ffor su
uccces
ssfu
ul pay
p yme entt /// pa
aym
ment confirmation
ata
Da a ite
em f A an
ms for nd B are
a e interrchange
eab
ble
5 (a)) (i) • So
o th
hat the
e dat
d a / infforrmaatio
on is sav
s vedd afte
a er the prrog gram m is
i rrun
n / wh
whenn th
he Max
M x1
compputter is sw
witc
cheed ooff
• o th
So he dat
d ta / in
nforrmation ca an be accce
esssedd neextt tim
me
e thhe pro
p ogramm is
s ru
un
• So
o th
he dat
d ta infoorm
mation can
c n be "pe
" ermmannenntly
y sttoreed""
© Ca
amb
brid
dge
e In
nterrnattion
nal Ex
xam
mina
atio
ons
s 20
016
6
Page 8 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – May/June 2016 9608 22
(ii) Problem: 4
• When retrieving / searching for / editing (text relating to a particular CD)
• Can’t tell where the artist name stops and the title begins (or any similar
explanation or example)
Solution 1:
• Use of a separator character// or by example
• Where the separator character does not occur in the original strings
Solution 2:
• Use a fixed number of characters for each data item
• Data items are padded with e.g. <Space> character where needed
Solution 3:
• Convert original data items to CamelCase
• …and add a Space separator
Mark as follows:
Two marks for description of problem
Two marks for description of solution
(b) 'Pseudocode' solution included here for development and clarification of mark Max 8
scheme.
Programming language solutions appear in the Appendix.
PROCEDURE InputData()
CLOSEFILE("MyMusic.txt ")
ENDPROCEDURE
Solutions may repeatedly OPEN – WRITE – CLOSE within the loop.In this case the first
OPEN could be in WRITE or APPEND mode with all others in APPEND.
Ques
Qu stio
on An
nsw
wer Marrks
s
6 (a)) n f x y MI
ID(S
Str
rin
ng1
1, x
x, 1) M D(S
MID Str
rin
ng2, y,
y 1)
) 6
0
0 0
1 1 1 'R
R' 'R
R'
2 2 'E
E' 'A
A'
2 2 1 'E
E' 'R
R'
3 3 1 'T
T' 'R
R'
4 4 1 'R
R' 'R
R'
5 2 'A
A' 'A
A'
6 3 'C
C' 'C
C'
4
One mark
k per co
orre
ect co
olum
mn
n
• Minus one
o e mar
m rk iff anytthing els se on
n firrst row
w
• Coolummnn 2 – '4' mu ustt no
ot pre
p eceede
e '4
4' in
n coolu
umnn 1 (a
as sho
s ow
wn b
by arrrow
w)
• Le ers mu
ette ustt all be in uuppperr ca
asee
• Ign
norre quo
q otaatioon sym
s mb bol
Firstt mark
k poin
p nt: allow
w lo
oca
ate / fiind
d / cal
c culate
e pos
p sitio
on of
(ii) Va
alu
ue: 0 / ze
ero
o 2
Meanin tring2 no
ng: St ot fou
f und
d in ng1
n Strin 1
(iii) Optiion
n1 2
• It is pos
p ssib ble
e to
o “fa
all offf” th
he en o Stri
nd of ing g1 (orr by
y exa
e ampple
e) whi
w le strring
g
ma h (ffor ex
atch xammplle, Sttring1 = "R Retrrac
ce", Strin
ng2
2 = "RRacced
d")
• MIID (S Str ring g1, x, x 1)// de esc
crip
ptio
on of
o 'su
' bscript out of raang
ge''
Optiion
n2
• e herr sttring is em
If eith e ptyy th
henn
• subsc crip
pt ooutt off ra
ang
ge errrorr // de
escripttion
n
Optiion
n3
• If Str
S ing
g1 ffou und
d with
w hin String
g2
• Ann enndllesss loop will
w occcu
ur
© Ca
amb
brid
dge
e In
nterrnattion
nal Ex
xam
mina
atio
ons
s 20
016
6
Page 11 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – May/June 2016 9608 22
ALTERNATIVE:
ALTERNATIVE:
ALTERNATIVE:
5 (b): VB.NET
A StreamWriter() solution:
Sub InputData()
Dim CDTitle, CDArtist, CDLocation As String
Dim FileHandle As IO.StreamWriter
FileHandle = New IO.StreamWriter("MyMusic.txt") ("MyMusic.txt")
Console.WriteLine("Input CD Title: ")
CDTitle = Console.ReadLine()
Do Until CDTitle = "##"
Console.WriteLine("Input CD Artist: ")
CDArtist = Console.ReadLine()
Console.WriteLine("Input CD Location: ")
CDLocation = Console.ReadLine()
FileHandle.WriteLine(CDTitle & ":" & CDArtist & ":" & CDLocation)
Console.WriteLine("Input CD Title: ")
CDTitle = Console.ReadLine()
Loop
FileHandle.Close()
End Sub
Sub InputData()
Dim CDTitle, CDArtist, CDLocation As String
FileOpen(1, "MyMusic", OpenMode.Output)
Console.WriteLine("Input CD Title: ")
CDTitle = Console.ReadLine()
Do Until CDTitle = "##"
Console.WriteLine("Input CD Artist: ")
CDArtist = Console.ReadLine()
Console.WriteLine("Input CD Location: ")
CDLocation = Console.ReadLine()
Print(1, CDTitle & ":" & CDArtist & ":" & CDLocation)
Console.WriteLine("Input CD Title: ")
CDTitle = Console.ReadLine()
Loop
FileClose(1)
End Sub
5 (b): Pascal
procedure InputData;
var
CDTitle, CDArtist, CDLocation : string;
CDFile : Textfile;
begin
assign(CDFile, 'MyMusic');
rewrite(CDFile);
writeln('Input CD Title: ');
readln(CDTitle);
while (CDTitle <> '##') do
begin
writeln('Input CD Artist: ');
readln(CDArtist);
writeln('Input CD Location: ');
readln(CDLocation);
writeln(CDFile, CDTitle + ':' + CDArtist + ':' + CDLocation);
writeln('Input CD Title: ');
readln(CDTitle);
end;
close(CDFile);
end;
5 (b): Python
def InputData() :
#CDTitle String (or CDTitle = "")
#CDArtist String (or CDArtist = "")
#CDLocation String (or CDLocation = "")