星期三上午computer science paper 2 sl计算机科学.pdf
M13/5/COMSC/SP2/ENG/TZ0/XX
COMPUTERSCIENCE
STANDARDLEVEL
PAPER2
Wednesday15May2013(morning)
1hour30minutes
INSTRUCTIONSTOCANDIDATES
• Donotopenthiaminationpaperuntilinstructedtodoso.
• Answerallthequestions.
• AcleancopyoftheComputerSciencecasestudyisrequiredforthispaper.
• Theummarkforthiaminationpaperis[70marks].
2213-70144pages
©InternationalBaccalaureateOrganization2013
–2–M13/5/COMSC/SP2/ENG/TZ0/XX
Answerallthequestions.
1. Datatypesanddatastructuresareanimportantfeatureofeveryprogramminglanguage.
(a) Statetwopossibleconsequencesofselectingthewrongdatatypeforthedata
thatyouintendtostore.[2marks]
(b) Outlineasetofdatathatcouldbestoredinaone-dimensionalarrayofBoolean.[2marks]
(c) ConstructthemethodhowMany()thatwillinspectyourBooleanarrayin
part(b)anddisplaythenumberofoccurrencesofeachofthedifferentvalues
storedinit. Youcanassumethatthesizeofthearrayis100,andthatyour
datastructureisdeclaredglobally.[5marks]
Thetablebelowshowsthewagespaidtofveemployeesforeachmonthoftheyear
(ineuros).
JanFebMarAprMayJuneJulAugSepOctNovDec
Adams245625462967305723472107234630493246354659403747
Parr546335467564354738563546453635462435347546573564
Rooney463546574697483943643465553635462375354635462435
Song634676864657967536456354976524353542635436473748
Suarez253325362175186923981384134628132738273812962375