Академический Документы
Профессиональный Документы
Культура Документы
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.
(ii) [6]
(iii) [2]
Expression Result
2 (a) [5]
Accelerator position
Values: 0 to 100 in steps of 1
Accelerator INTEGER
Meaning:
0 : none (not pressed)
100: maximum (fully pressed)
( )
(b) [6
6]
IN
NPUT
T Acc
A cel
lera
ato
or
IN
NPUT
T E gin
Eng neTe
emp
p
1
IN
NPUT
T N rma
Nor alTe
emp
p
IN
NPUT
T S eed
Spe d
3
IF Ac
cce
ele
era
ator
r = 0 A
AND
D En
ngi
ineeTe
emp
p >=
= N
Nor
rma
alTe
emp
p AND
A D Spee
ed = 0
TH
HEN
N
E gin
Eng neSt
top
p ← T
TRU
UE 4
2
EL
LSE
E
E gin
Eng neSt
top
p ← F LSE
FAL 5
EN
ND
DIF
F
OU
UTPU
UT "E
Eng
gine
e Sto
S opp
ped
d" 6
M rk points
Mar s as
a ccirc
cled, de
escripttion
ns as
s be
elo
ow:
1.
1 Four IN
NPPUT T stattemmenntss (c
corrrec
ct nam
n mes s and
a d se
equ uence e)
2
2. Corr
C rec ct IF.
I ..T THEN N..EL LSEE..END DIFF in
nclu
uding
g firrst conditio
on (orr eq
quiiva
alen
nt nes
n sted IFs
I s)
3
3. Corr
C rec ct sec
s con nd and
a d th
hirdd con
c ndittionns
4
4. Corr
C rec ct THE
T EN sta ate
emeentt
5
5. Corr
C rec ct ELS
E SE sta ate
emeentt
6
6. Outp
O putt inndiccatting
g Eng
E gine eStopp
(F
Follow
winng EENDIF or a tw
o as wo sep paratte sta
s temmeentss with
w hin TH N and
HEN a d EL LSE)
3 (
(a) [[11]
FUN
F TION
NCT N Dec
D cry
ypt Loo
t (L oku
up : ARR
A RAYY, Ci
iph
heerC
Cha
ar : CHA
AR) RET
R TURNS CH
RN HAR
R
D
DEC
CLA
ARRE Fo
oun
nd : BOO
B OLEAAN
D
DEC
CLA
ARRE In
nde
ex : INT
I TEGEER
D
DEC
CLA
ARRE Or
rig
ginnalC ar : CHA
Cha C ARR
I dex ← 1
Ind // tar
/st rt
t w
wit
th fi
irstt ele
e emeent
t in
n the
t e arr
a raay //
/
a si
as ign
n the
t e st
tarrt in
nde
exx
F und ← F
Fou FAL
LSEE
///no
ow seearch fo or Ciiphe
erCChaar inn Loooo
okuup:
W
WHI
ILEE Fo nd = FA
oun AL
LSEE //
/ Fo ouund < TR
d <> RUEE //
/ NOT
N T Fo
F unnd
// coomp
parre CippheerC
Chaar wit
w th th his
s arrra
ay ellem
mentt:
I Loo
IF up[In
L oku nddex
x] = Ci iph
herCChaar
TH
HEN
N
Fo nd ← TRU
oun T UE // Seet thhe flaag
ELSE
EL E
In ex ← Ind
nde I dex + 1 //M
Movve too nnext arr
a ray
y el
e emmen
nt
E DIF
EN
E DWHILE
END E
/ drop
//d ppe
ed ouut of lo oop
p so
s mus
m st ha ave
e fooun
nd Ciiph
herCChaar:
:
O
Ori
iginnal
lCh
harr ← CH HR
R(IInd
dexx) // conc nveertt In
ndeex to
o or
o iggin
nall ch
c arac
cte
er
R
RET
TUR N Ori
RN O igiina
alChharr
E DFU
END UNCTIO
ON
O e mar
One m rk for
f r ea
ach
h partt-sttate
em
men
nt (s
sho
owwn und
u derrlin
ned
d an
nd bo
old))
© Ca
amb
brid
dge
e In
nterrnattion
nal Ex
xam
mina
atio
ons
s 20
016
6
Pag
P ge 5 Mar
M k Sch
S hemme
e Sylllab
S bus Pape
P 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
23
( ) 'P
(b) Pseu
udo
ocoode
e' s
sollution
n in
ncllud
ded
d her
h re fforr de
eve
elo
opm me
ent an
nd claarifficatiion
n of th
he mark
k
s hem
sch mee. Pro
P ogrram
mmmingg lannguuag
ge ex
xam
mple so s luttions ap
ppe
earr in
n th
he Ap ppenndixx. [6
6]
INP
PUT
T S
Sta
art
tInd
dex
x
1
INP
PUT
T Num
N mbe
erTo
oOu
utp
put
t
FOR
R Ind x ← St
I dex tart
tIn
nde
ex to St
tar
rtI
Ind
dex + Nu
umb
berToO
Out
tpu
ut - 1
Or
rig ar ← CHR
nalCha
gin Index)
C R(I 3
4
2 Ci
iph
her har ← L
rCh Loo up[Ind
oku dex
x]
5
T ("Inde
O PUT
OUP ex " & Ind
dex
x & ":
" Cha ara
act r " & Or
ter rig nalC
gin ar &
Cha
" has
s sub
s bst
titu
ute
e c
cha
ara er " & Ciphe
acte erC ar)
Cha
6
END
DFO
OR
M rk points
Mar s as
a ccirc
cled, de
escripttion
ns as
s be
elo
ow:
1.
1 Twwoo IN
NPUT T sttate
em
men nts
2
2. Wor
W rkin ng loo
op using g In
ndeex (allow
w alte
a erna ativ
ve so ns inc
oluttion clud
ding sep
s parrate
e lo
oop
p cou
c unte
er)
3
3. Ass
A ign nmeentt (u
using coorre
ect va
aluees of Inddexx or
o oth
o er va aria
able
e)
4
4. Ass
A ign nmeentt (u
using coorre
ect va
aluees of Inddexx or
o oth
o er va aria
able
e)
5
5. One
O e mar
m rk foor OUUTPU UT of a stri
s ng co ombin ning textt and va aria
able
es...
6
6. ...a sec
s con
nd ma ark
k if OU
UTTPUUT strring
g iss com
c mplete ely co orre
ect
4 (
(a) • Functio
ons s / Prroc
cedurees [2
2]
• A ity to pa
Abil asss paara
ame ete
ers be
etw
wee
en m
mo
odu
ules
s
• Use
U e off lo
ocal / glo
oba v iab
al var bles
s
© Ca
amb
brid
dge
e In
nterrnattion
nal Ex
xam
mina
atio
ons
s 20
016
6
Pag
P ge 6 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
23
( ) (i)
(b) ( [1]
One
O e mar
m rk fo
or corre
ect arrrow
w as
a sho
s own – acce
eptt eithe
er dirrecttion
(ii) [4
4]
P
Param
metter
Da
ata
a Ite
em
m
A B C D E F
Prod
P ducct ID
I ()
Qua
Q antiity )
(
Flag
g Valu
V ue – indicaatin
ng
operattion
n succ
ces
ss or faiil
Mar
M rk as
a foll
f low
ws:
Row
R w 1: One
O e mar
m rk for
f ticck in A AND
A DB B, one
o e ma
m rk forr D OR E
Row
R w 2: One
O e mar
m rk for
f D OR R E (m
muust be
e op
ppo
osite of Roow 1)
Row
R w 3: One
O e mar
m rk for
f C AN ND F
© Ca
amb
brid
dge
e In
nterrnattion
nal Ex
xam
mina
atio
ons
s 20
016
6
Page 7 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – May/June 2016 9608 23
Drawback:
• Takes up more / unnecessary space in the file
• If the string is bigger than 40 characters then data will be lost // string length is
limited
• The additional spaces will need to be removed before strings can be used
(ii) Problem: File mode = WRITE / file is opened for writing // by explanation [3]
Effect: All existing file lines / contents / data will be overwritten / deleted / lost
(b) 'Pseudocode' solution included here for development and clarification of mark scheme.
Programming language example solutions appear in the Appendix. [Max 10]
PROCEDURE OutputLocationList()
Total ← 0
ENDPROCEDURE
6 (
(a) (
(i) [4
4]
n x Fla
F ag m N
New
wString
g
– TRU
T UE 7 “
“”
1 ‘B
B FA
ALSE
E “B”
2 ‘i’ “B
Bi”
3 ‘g
g’ “B
Big””
4 ‘▽
▽’ TRU
T UE “Biig▽“
5 ‘B
B’ FA
ALSE
E “Big
“ g▽BB”
6 ‘e
e’ “B
Big
g▽B
Be”
7 ‘n
n’ “B ▽Be
Big▽ en””
One
O e mar
m rk p
perr co
orre
ectt co
olumn
n (c
collum
mn
ns 3 and
a d 4 co
oun
nt as 1))
• Arrrow
wss indiccate
e req
r uirred se
equ
uennce
e (i.e. “B
B” ccan
n’t be in ro
ow befforre TR
TRUE
E)
• Leette
er ccas
se mu ust be
e as sho
s own
n
• Ignore quota atio
on symbbol
• Allow o ▽ fo
w “ “ or or spa
s acee sym
s mbo
ol
(ii) (T
To retturn a sttrin
ng wh
where
e:) [2
2]
• Th
he firsst cha
c ara
acte
er o
of eac
e ch wo d is ca
ord apittaliise
ed / mad
m de upp
u perr ca
ase
e /// byy exp
e plan
nattion
n
• Th
he rem maaining ch
harrac
cterrs (of
( eaachh word
w d) are a e mad
m de lowwerr ca
ase
e
( ) (i)
(b) ( • Th
he fun
ncttion
n operattes
s no
orm
mallly // retu
r urnns an
a ‘em
mp
pty strring
g’ [1]
(ii) Examp
ples o
of suit
s tabble tesst stri
s inggs: [3
3]
• Sttrin
ngss with alll ca
apitals
• Sttrin
ngss with alll lo
oweer cas
c se
• Sttrin
ngss with firs
st lett
l ters
s of
o wor
w rdss allrea adyy cap
c pita alise e. in cor
ed (i.e c rrect forrma
at)
• Sttrin
ngss in “re
eveersse” format – i.e. firrst lettterrs lo
ow
wer ca ase
e, thhe res
st up
u per case e
• Sttrin
ng wwith only
o y one
o e word
w d
• Sttrin
ngss with multiiplee spa
s aces
• ngss with nu
Sttrin umbers / sy ymmbo
ols
One
O e mar or ea
m rk fo ach string exa
e ample
epplus
s sup
s ppo
ortin
ng ex
xpla
ana
atio
on.
© Ca
amb
brid
dge
e In
nterrnattion
nal Ex
xam
mina
atio
ons
s 20
016
6
Page 10 Mark Scheme Syllabus Paper
Cambridge International AS/A Level – May/June 2016 9608 23
Q3 (b): VB.NET
Q3 (b): Pascal
Q3 (b): Python
Q5 (b): VB.NET
A StreamReader() solution:
Sub OutPutLocationList()
Total = 0
Console.WriteLine("Input location to search ")
CDSearch = Console.ReadLine
Do While ObjReader.Peek <> -1
FileData = ObjReader.ReadLine()
If Right(FileData, 8) = CDLocation Then
CDTitle = Left(FileData, 40)
CDArtist = Mid(FileData, 41, 40)
Console.WriteLine(CDTitle & " " & CDArtist)
Total = Total + 1
End If
Loop
Console.WriteLine(Total & " CDs were found")
ObjReader.Close()
End Sub
Sub OutPutLocationList()
Total = 0
Console.WriteLine("Input location to search ")
CDSearch = Console.ReadLine
Do While NOT EOF(1)
Input(1, FileData)
If Right(FileData, 8) = CDSearch Then
CDTitle = Left(FileData, 40)
CDArtist = Mid(FileData, 41, 40)
Console.WriteLine(CDTitle & " " & CDArtist)
Total = Total + 1
End If
Loop
Console.WriteLine(Total & " CDs were found")
FileClose(1)
End Sub
Q5 (b): Pascal
procedure OutputLocationList;
var
FileData, CDLocation, CDTitle, CDArtist : String;
CDFile : Textfile;
Total : Integer;
Begin
Total := 0;
Writeln('Input location to search ');
Readln(CDSearch);
AssignFile(CDFIle, 'MyMusic.txt');
Reset(CDFile);
End
Q5 (b): Python
#total : Integer
#CDSearch, LineOfText, LineString : String
Def OutPutLocationList():
FileHandle = open("MyMusicPy.TXT", "r")
total = 0
CDSearch = input("Enter location to search")
LineOfText = FileHandle.readline()
while len(LineOfText) > 0:
LineString = LineOfText[80:87] #extact last 8 characters
(location)
if LineString == CDSearch:
total = total+1
CDTitle = LineOfText[0:39] #extract CD title
CDArtist = LineOfText[40:79] #extract CD artist
print(CDTitle + ": " + CDArtist)
LineOfText = FileHandle.readline() #read next line
print("There are " + str(total) + " in that location")
FileHandle.close()