0% found this document useful (0 votes)
15 views32 pages

Chap 8 Marking Scheme

The document is a Cambridge O Level Mark Scheme for May/June 2019, detailing the marking criteria for various programming-related questions. It includes sample answers, explanations of data structures, and validation techniques, along with specific marks allocated for each part of the questions. The document serves as a guide for assessing student responses in programming tasks.

Uploaded by

mazinamin60
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views32 pages

Chap 8 Marking Scheme

The document is a Cambridge O Level Mark Scheme for May/June 2019, detailing the marking criteria for various programming-related questions. It includes sample answers, explanations of data structures, and validation techniques, along with specific marks allocated for each part of the questions. The document serves as a guide for assessing student responses in programming tasks.

Uploaded by

mazinamin60
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

3$*(

&+$37(5

0$5.,1*
6&+(0(
3$*(
3$*(

2210/21 Cambridge O Level – Mark Scheme May/June 2019


PUBLISHED

Question Answer Marks

1(a)(i) Many correct answers, the name must be meaningful. Must relate to Task 1 3
1 mark per bullet point

e.g.1
 Array BusA
 Data type integer
 Purpose storing the minutes late

e.g.2
 Array Day
 Data type string
 Purpose storing the code for the day of the week

1(a)(ii) Many correct answers, the name must be meaningful. Names shown are 6
examples only.
1 mark per bullet point

 Task 2 variable name BusAMinsLate


 Data type real
 Purpose used in calculation of average minutes late

 Taskk 3 va variable
ariab e name
ble SearchDay
 Data
D ata
at a type
t y pe
ty string
stri
st r ng
g
 Purpose
P urpo
ur pose
po to iinput
n utt tthe
np day
he d ay tto
o be ssearched
ea
arc
rch
hed
d fo
for

1(b) 1 mark
mar
arkk for
for each
e ch point::
ea 6
MP1
MP1 Conditiona
n l statement to identify when a bus is late (punctuality
na
Conditional
< 0)
MP
MP2P2 Count the e number of late days for at least one bus route
MP3 e late minutes for at least one bus route
Total the
MP4 Calculation
Calculatioon of average minutes late

1 mark for each point (max


max three points):
(m
MP5 Initialisation
on of counting/totalling variables
Initialisatio
MP6 Iteration through days
MP7 Checking all buses«
MP8 Count late days and total minutes for all bus routes
MP9 Output of number of late arrivals or average minutes late for at
least one bus route«
MP10 Output complete with all bus routes with late arrivals and
average minutes late, with appropriate messages

Example algorithm on next page

© UCLES 2019 Page 3 of 9


3$*(

2210/21 Cambridge O Level – Mark Scheme May/June 2019


PUBLISHED

Question Answer Marks

1(b) Example algorithm


CountA m 0; CountB m 0; CountC m 0; CountD m 0;
CountE m 0; CountF m 0
TotalA m 0; TotalB m 0; TotalC m 0; TotalD m 0;
TotalE m 0; TotalF m 0
FOR Days m 0 to 19
IF BusA[Days] < 0
THEN
CountA m CountA + 1
TotalA m TotalA + BusA[Days]
ENDIF
IF BusB[Days] < 0
THEN
CountB m CountB + 1
TotalB m TotalB + BusBA[Days]
ENDIF
IF BusC[Days] < 0
THEN
CountC m CountC + 1
TotaalC m TotalC + BusC[Days]
TotalC
ENDIF
BussD[
D[Da
D ys] < 0
IF BusD[Days]
THEN
THEN
CountD m CountD
CountD Cou
ount
ntD
nt D + 1
TotalD m TotalD + BusD[Days]
ENDIF
END
NDIF
IF
IF BusE[Days]
BusE[Days] < 0
THEN
TH
CountE m CountE + 1
TotalE m TotalE + BusE[Days]
ENDIF
IF BusF[Days] < 0
THEN
CountF m CountF + 1
TotalF m TotalF + BusF[Days]
ENDIF
NEXT
PRINT "The number of late days for each bus route are:
Bus A "CountA", Bus B "CountB", Bus C "CountC", Bus D ",
CountD", Bus E ", CountE", Bus F "CountF
PRINT "The average number of minutes late for each route
are: Bus A "TotalA/20", Bus B "TotalB/20", Bus C
"TotalC/20", Bus D ", TotalD/20", Bus E ", TotalE/20",
Bus F "TotalF/20

© UCLES 2019 Page 4 of 9


3$*(

2210/21 Cambridge O Level – Mark Scheme May/June 2019


PUBLISHED

Question Answer Marks

1(c) Explanation of how the candidate’s program performed the following: 3

Three from:
MP1 The input stored as a variable
MP2 The method used to find the position of the day in the Day
array that matches the input
MP3 The array index is stored as a variable
MP4 The index variable used as the array index for each bus array
MP5 «and the contents of each array stored/output.

1(d) Two from: 2


MP1 Add a user input and prompt to enter the number of weeks
required to record data on arrival times
MP2 Store the user input for number of weeks as a variable
MP3 Calculation to change number of weeks to number of days
MP4 Replace the upper limit of the loop with a variable
MP5 Increase the maximum size of the arrays to accommodate a
higher number of weeks

Question Answer Marks

2 Many possible
possibl
ble
bl e answers,
an
a nswerrs, those given are examples only. 6
1 mark
rk for
for
o each
eac
a h correct
correcct description
desc
scri
sc rip
ptio
on and
a d 1 mark
an m rk
ma r for
for each
eac
ach
ac h correct
co
orr
rre
ectt example
exxam
ample
e

Cha
Ch ar
ar
Char
D
De s ri
sc ript
ptio
pt ion:
io
Description: n: A single ccharacter
haracter (from the keyboard)
Ex
xampl
am
mplple:
Example: e
e: A/#/2

Stri
St ring
ri
Stringng
g
D escription: An (ordered)
Description: (orde
ered) sequence of characters
Example: world
orld / #123?Y / 234 78963
Hello wo
or

Boolean
Description: A data type
p with two possible values
Example: TRUE / FALSE

© UCLES 2019 Page 5 of 9


3$*(

2210/21 Cambridge O Level – Mark Scheme May/June 2019


PUBLISHED

Question Answer Marks

3(a) Many possible answers, those given are examples only. 2


1 mark per bullet:
 IF
 Condition and outcome

Example answer:
IF X < 0
THEN
PRINT "Negative"
ELSE
PRINT "Not negative"
ENDIF

OR

1 mark per bullet:


 CASE
 Condition and outcome

Example answer:
CASE X OF
1: PRINT ("ONE")
("
"ON
O E")
2: PRINT
PRINNT ("TWO")
("
"TWWO")
OTHERWISE
OTHER
ERWI
ER WI SE PRINT
ISE PRIINT ("Less
("L
"Leess than
t an
th an ONE
E or
ONE or more
mo than
n TWO")
than TWO
TW O")
)
ENDCASE
ENDC
EN DC
D CAS
A E

3(b)  T
Too al
a low diffe
allow erent routes through a program
different 2
 d ep
pendent on
dependent n meeting certain criteria

Question Answer Marks

4(a) Range check 1

4(b) Two from: 2

 The entered number (Value)is being checked to see that it is not


< 0 or not > 100
 If it is, it is rejected and the user has to enter another number / an
error message is displayed
 Otherwise the number is accepted, the word ‘Accepted’ is output
along with the Value

© UCLES 2019 Page 6 of 9


3$*(

2210/22 Cambridge O Level – Mark Scheme May/June 2019


PUBLISHED

Question Answer Marks

Section A

1(a) 4 marks for: 5


Data Structure(s) max 2
x Arrays
x Variable(s) for // data entry such as reserve price // index / constant
for minimum number of items
Further description max 3
x Data type(s) one or more
x Use(s) one or more
x Name(s) one or more e.g. Item_Number, NumberBids,
Description, Reserve Price
x Sample data for appropriate arrays e.g. 1234, 0, vase, 20.00 //
Sample data for variable or constant e.g. 10
1 mark for:
x At least four appropriate named arrays with sample data

1(b) x Keep a counter/number 2


x Add one every
ry time a new item is added
or
x Keep a lilist
ist of numbers
of n umbers used
x Usingg a lloop
oopp check
check number is not already in the list before a new
item
em number
nu
ummber iss added
add
dd
ded

© UCLES 2019 Page 3 of 9


3$*(

2210/22 Cambridge O Level – Mark Scheme May/June 2019


PUBLISHED

Question Answer Marks

1(c) Five from: 5


MP1 Enter Buyer Number
MP2 Check if buyer number valid
MP3 Enter new bid
MP4 Check if new bid less than or equal to current highest bid «
MP5 « if so reject
MP6 « Otherwise store the bid entered as new highest bid
MP7 Increase number of bids by one
MP8 Store Buyer Number

Sample answer

REPEAT
PRINT "Enter Buyer Number"
INPUT BuyerNumber
UNTIL BuyerNumber >= BuyerLow and BuyerNumber <=
BuyerHigh
REPEAT
PRINT "Enter Bid B d -99 to exit"
Bi
INPUT Bid
IF Bid > HighestBid(item)
High
ghe
gh estBid(item)
THEN
Hig
ighe
ighe tBid(item) ĸ Bid
h st
HighestBid(item)
Num
umberBBids(s(
(it
item)
NumberBids(item) ) ĸ NumberBids(item)
Num
u beerB
rBid
i s(
(it
i em
em)) + 1
END
N IF
ENDIFF
UN
NTI
TIL Bid
TIL
UNTIL Bid > HighestBid(item)
Highes
estBBid
id(i
(ite
(i t m) OR
te OR Bid
Bi
id = -99
-9
99
F Bid
IF Bidd <>
<> -99
THEN
HE
THEN
Buye
Bu yerItem((item) ĸ BuyerNumber
BuyerItem(item)
ENDI
ENDI
DIF
ENDIFF

possib
ble correct answers, this is an example only.
There are many possible

1(d) Three from: 3


MP1 Using index nu umber of item, to find if any bids for item exist
number
MP2 Using IF/UNTIL/WHILE (statement) to compare new bid with
highest/latest bid recorded
MP3 Use an assignment (statement) to replace current highest bid, if
new bid greater than current highest bid
MP4 « else reject bid // using a (REPEAT/WHILE) loop ask for bid to be
re-entered
MP5 If number of bids / highest bid = zero add bid (provided greater than
zero)

© UCLES 2019 Page 4 of 9


3$*(

2210/22 Cambridge O Level – Mark Scheme May/June 2019


PUBLISHED

Question Answer Marks

1(e) Explanation of how the candidate’s program performed the following. 5

Five from:
MP1 Method to search item arrays
MP2 Conditional statement used to check for the successful bids
MP3 « equal to / greater than reserve price
MP4 Method used to calculate 10% percent of successful bid (for each
item)
MP5 «and add to auction company total fee
MP6 Method used to display total fee with a suitable message

All programming statements used must be explained.

© UCLES 2019 Page 5 of 9


3$*(

2210/22 Cambridge O Level – Mark Scheme May/June 2019


PUBLISHED

Question Answer Marks

4 4
Statements Selection Repetition

FOR A ĸ 1 TO 100
B ĸ B + 1 9
NEXT A

CASE A OF
100: B ĸ A
9
200: C ĸ A
ENDCASE

IF A > 100
THEN
9
B ĸ A
ENDIF

REPEAT
A ĸ B * 10 9
UNTIL A > 100

1 mark for each co


corr
correct
rrec
rr ecct row

Question Answer
Answ
An wer Marks
Marks

5 Validation
V
Vaaliidatitiion
on 6
Two
Tw o from:
fro
fr om
om:
x a automated
u omated checking
ut che
hecking
he
x cchecking
hecking thatt data
data is reasonable / of a certain type
x checking thatt data data meets certain criteria

Example 1 mark
x range check //
// length check // type check // check digit etc.

Verification
Two from:
x checking that data has not changed«
x « during input to a computer
x « during transfer between computers / devices

Example 1 mark
x double entry // checking against original // visual check // use of
checksum etc.

© UCLES 2019 Page 8 of 9


3$*(

2210/22 Cambridge O Level – Mark Scheme October/November


PUBLISHED 2019

Section A

Question Answer Marks

1(a)(i) Data Structure(s) maximum two marks 5


x Array
x Variable
x Constant

Description maximum three marks


x Name(s) one or more e.g. Colour
x Data type(s) one or more e.g. String
x Use(s) one or more e.g. To store the colour of the slab

Additional data structure description using the same data structure type
maximum one mark
x Two or more full descriptions of the data structure including name, data
type and use

1(a)(ii) x Variable name e.g. ConcretePrice 3


x Data type e.g. Rea
Real
al
al
x Use e.g. To store
e tthe
he price of the grade of concrete

1(b) Three from: 3


x Using the he shape,
sha pe, size
hap size and
siz and depth
depth th «
x « ttheheea area
r a of
re of the shape
shapee is
is found
foun
unnd «
x « ffor allll e
orr a except
xcept round
ro und multiply
oun mult
mu iplyy length
ltiiply
lt len gtth by breadth/show
engt bre
read
adth
ad h/s
/sho
how
ho w example
exam
ex ampl
plee«
x « for or rround ply Pi by half the diameter/radius squared «
multiply
ound multip ply
x «m multiply
ulti
ul plyy the area
tipl
pl a by the depth to give the volume

© UCLES 2019 Page 3 of 7


3$*(

2210/22 Cambridge O Level – Mark Scheme October/November


PUBLISHED 2019

Question Answer Marks

1(c) Five from: 5


MP1 Enter number of slabs to purchase with prompt
MP2 Check if less than 20 or greater than 100 «
MP3 « if so, reject the number and re-enter a value
MP4 Attempt to round the number of slabs to the next 20 «
MP5 Accurate attempt to round up to the next 20
MP6 Calculate the number of batches
MP7 Calculate price to pay (number of batches u price per batch from
Task 1)
MP8 Display price and number of slabs produced «
MP9 « Suitable output message(s)

Sample answer
REPEAT
PRINT "Enter Number of slabs to purchase"
INPUT Number
UNTIL Number >= 20 and Number <= 100
PurchaseNo  Number
IF Number > 20 AND D Number <= 40 THEN PurchaseNo  40
ENDIF
IF Number > 40 AND D Number <= 60 THEN PurchaseNo  60
AND
ENDIF
IF Number > 60 D Number <= 80 THEN PurchaseNo  80
60 AND
ND
ENDIF F
IF Number
IF Num
um er > 80 THEN
umbe THE
HE
EN PurchaseNo
Purc
Pu rcha
rc hase
seNo
se o  100
No 100
0 ENDIF
END
NDIF
IF
F
Baatc
tchN
hNo
hN
BatchNo o  PurchaseNo
Purchas
seNo / 20
Prric
ceT ToP
oPay
PriceToPay y  BatchNo
ay Batch
c No * BatchPrice //BatchPrice
ch
c
calc
alc
lcul
ulat
ul ated
calculatedted in Task k 1
PRRIN
INT
PRINT T "Price
"Pri
"P rice for ",
", PurchaseNo, " Slabs is $", PriceToPay

1 (d) Fourr from explanations:


explanationss: 4
x Enter the price of thehe concrete
th
x Store the price of thehe concrete
th
x Set up variable(s) for or grades
fo
x Input the grade
x The price that is input is used in the final price calculation instead of 0.05
x The price calculation depends on the grade input e.g. 1.07 u price or
price + price u 0.07 for Best

If no programming code seen to support at least one explanation maximum of


three marks can be awarded.

© UCLES 2019 Page 4 of 7


3$*(

2210/22 Cambridge O Level – Mark Scheme October/November


PUBLISHED 2019

Questio Answer Mark


n s

4 3

One mark for each correct line, up to maximum of three marks.

Questio Answer Mark


n s

5 Totalling:
Tota
To t lllin
ta ing:
g: 4
x A Adding
d in
dd the
ng th off ea
he weight o each basket
ach b asske o tthe
et to total
he tot
ota
ot al w
al weight
eiigh each
ht as e ach
ac weight
h we
weig
ight
ht iss
entered
ente
en tere
red
re d
x To Total
T tal = Total + Weight
tal

Counting:
C
Co unti
un ting
ti ng::
ng
x A Adding
dding one to/incre
to/incrementing
ementing the number of baskets as each weight is
entered
x BasketCount = BasketCount
BasketCount + 1

© UCLES 2019 Page 6 of 7


3$*(

2210/22 Cambridge O Level – Mark Scheme October/November


PUBLISHED 2019

Questio Answer Mark


n s

6 Constants 6
Two from:
x The value cannot be changed accidentally «
x « during the execution of the program
x Value only needs to be changed once if circumstances change/during the
initialisation process

Variables
Two from:
x Stores a value that can change «
x « during the execution of the program
x Can use a variable without knowing its value

Arrays
Two from:
x A list of items of the same data type «
x « stored under a single name
x To reduce the num
number
mber of variables used
x Any item can be foundund using an index number to show its place in the list
fou

Questio Answer
A
An sw
wer
e Mark
Mark
M
n s

7(a) x N umbe
um be
b
Number er is repeated/not
repeate
ed/not unique 1

7(b)
b)) x IItem
tem number
tem
te numb
nu displayed/Amount
mber not dis
mb splayed/Amount column not required 5
x NNot
ot Like
Likke ‘Delivered’’ will
will also show cancelled items

Field: Item numberr Order number Status

Table: SALES SALES SALES

Sort:

Show:
; ; † †
Criteria: Like "Not
started"

or: Like "In


progress"

x Correct Item number column


x Correct Order number column and any additional column not shown
x Correct status column

© UCLES 2019 Page 7 of 7


3$*(

2210/23 Cambridge O Level – Mark Scheme October/November


PUBLISHED 2019

Question Answer Marks

1(a) Two examples of: 4


Any meaningful name for an array related to Task 1 – one mark, e.g.
 TileDescription
 TilePrice
 TileCode
Correct data type and purpose related to Task 1 – one mark, e.g.
 « string to store the name / description of the tiles
 « real to store the price of the tiles
 « string to store the tile codes

1(b) Any meaningful name for a variable related to Task 2 – one mark, e.g. 4
 NumberOfWalls
 TotalArea
 TotalCost

Relevant data type for the variable related to Task 2 – one mark, e.g.
 « Integer
 « Real

Relevant purpose for the


thee variable related to Task 2 – one mark, e.g.
 « to store the e number
nu
umb ber of walls that need to be tiled
 « to store e the
he total
th to area
area / cost

One
O
On emmark
ark fo
ar for
or a ccorrect reason,
orrect re
reaso e.g.
on,, e .g.
 V Variables
aria
ar ia
iabl
abl es allow the storage
bles storage of values within a program that may change as
the
th
he prprogram
prog
ogra
og raam runs // VVariables
ariables are used to store values that are input or
calculated
callc
ca lcul
lcul
ulat
a edd

© UCLES 2019 Page 3 of 8


3$*(

2210/23 Cambridge O Level – Mark Scheme October/November


PUBLISHED 2019

Question Answer Marks

1(c) Six from: 6


MP1 Input for height and width of the wall to tile and tile code
MP2 Prompts for all inputs seen
MP3 Validation of height and width
MP4 Reasonable attempt at validation of tile code
MP5 Calculation of the area of the wall
MP6 Calculation of the number of boxes rounded up
MP7 Looking up the cost of the tiles
MP8 Calculation of the cost of the boxes of the tiles
MP9 Output of area of the wall, the number of boxes and cost of tiles
needed
MP10 Appropriate message(s) with output

Example algorithm
REPEAT
OUTPUT "Please enter height of wall "
INPUT Height
UNTIL Height > 0

REPEAT
"Pleasse enter
OUTPUT "Please enter width of wall "
INPUT Width
h
UNTIL Width > 0

REPE
RE PEAT
PE
REPEATAT
T
Found
ound
Found d m FALSE
Cou
o nt
nter
Countererr m 0
REEP
PEA
EAT
REPEAT T
OUT
UTPU
PUT "Please
OUTPUT "Pleas
ase enter tile identification code "
as
INPUT MyTileId
INPUT MyTileI
e d
eI
IF MyTileId = TileCode(Counter)
THEN
t m TilePrice(Counter)
MyCost
Found m TRUE
ENDIF
Counter m Counter + 1
UNTIL Found OR Counter = 10
UNTIL Found

Area m Height * Width


NoBoxes m Int(Round (Area + 0.5))
// Rounds up to nearest Integer
TotalPrice m NoBoxes * MyCost

OUTPUT ("Area of wall is ", Area, " metres")


OUTPUT ("Number of boxes of tiles is ", Area, " NoBoxes)
OUTPUT ("Cost of Tiles is ", TotalPrice, " dollars"

© UCLES 2019 Page 4 of 8


3$*(

2210/23 Cambridge O Level – Mark Scheme October/November


PUBLISHED 2019

Question Answer Marks

1(d) Three from: 3


 Adding an extra user input for number of walls «
 « using this value as a loop counter
 « so that separate inputs of height and width can be made for each wall
 Calculating a running total for the final area using the results of the area
calculation for each wall
 Rounding the final area or using previously rounded areas for the final total
 Displaying with a suitable message final area, final number of boxes of tiles
required and final cost

If only program statements given with no explanation, zero marks.

1(e) Three from: 3


 Check that only numbers are accepted // type check
 Check that the values are within boundaries // range check
 Check that a value has been entered // presence check
 Using an IF / conditional statement
 Identification of suitable lower value / acceptable value
 Identification of suita
suitable
able upper value / unacceptable value
 Alerting the user wwith
itth an error message if the input is unacceptable

© UCLES 2019 Page 5 of 8


3$*(

2210/23 Cambridge O Level – Mark Scheme October/November


PUBLISHED 2019

Question Answer Marks

2 Two from 2
 Sub-program / system not the whole program / system
 To perform a frequently used operation within a program
 That can be called when needed
 That can be reused by another program

Question Answer Marks

3  FOR (… TO … NEXT)loop 3
 WHILE (… DO … ENDWHILE) loop
 REPEAT (… UNTIL) loop

Question Answer Marks

4(a)  Conditional / selection statement 1

4(b) Four from: 4


MP1 CASE statementt with with identifier Response
struct
MP2 Correct structurectur
ct u e used
ur used for choices«
MP3 «. correc ct st
correct stat
atemments used for choices
statements
OTHE
MP4 OTHERWISEERWWISSE an nd co
and orr
rrec
ect stat
correct atemen
entt
statement
MPP5 Si
MP5 Sing
ng
gle
eE
Single NDCASE
ND
ENDCASE E inc
clu
lude
ded
de
included
e.g
e. g.
e.g.
CA
ASE
CASESE OF
OF Response
R sponse //
Re // CASE Response OF
1 : X ĸ X + Y
2 : X ĸ X - Y
3 : X ĸ X * Y
4 : X ĸ X / Y
OUTPU
OTHERWISE OUTPUT UT ƎNo responseƎ
ENDCASE

Question Answer Marks

5(a) First Last UserIn Middle Found 6


OUTPUT

0 16 FALSE

0 16 10 8 FALSE

0 7 10 3 FALSE

4 7 10 5 TRUE TRUE

One mark per correct column

© UCLES 2019 Page 6 of 8


2210/21 Cambridge O Level – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

1(a)(i) Any meaningful array related to Task 1 – one mark (max


ma two) e.g. 4
ItemCode
Description

on
ne m
Correct purpose for each array related to Task 1 – one ark
ar
rk (m
mark (max
ax
a two) e.g.
…to store the item codes
…to store the descriptions of the items for sale

1(a)(ii) Any meaningful variable related to Task 1 – one mark (max two)) e.
e
e.g.
g. 4
PurchaseItem
TotalPrice

Correct purpose for each variable related to Task 1 - one mark (max two) e.g.
… to allow input of an item/code for purchase
… to store/calculate the total price off the transaction

1(b) Any one correct statement e.g. 2


characte
t rs/not numbers
te
• The Code data is made up of letters/alphabetic characters/not
ed
• Real data must have numerical value/would not be used d in
in calculations
c lculations
ca
3$*(

One mark for:


• String

© UCLES 2020 Page 4 of 10


2210/21 Cambridge O Level – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

1(c) Any five from 5


de
• Input with message to allow choice of mobile device
d it
• Attempt to validate input to check for valid item
e ccode
em o e
od
valid
a id
• Accurate validation of input to check for val d iitem
te
tem
em cocode
ode
tab
• Determination of whether device is phone or tablet able
ab let
le
rrequired
• Restriction to only allow input for SIM card re quir ired mobile
red iiff mo
m bile device is a phone
e ui
eq
• Input with message to find out if a SIM card is rrequireduire
red
re d

Example answer
OUTPUT "Which type of phone or tablet would you like?
like
ke?
ke ? Input
I put the Item Code"
In
DeviceFlag ← False
WHILE DeviceFlag = False
INPUT DeviceCode
Count ← 0
WHILE Count<10 DO
IF DeviceCode = ItemCode[Count]
THEN
IF Count < 6
THEN
3$*(

DeviceType ← "Phone"
ELSE
DeviceType ← "Tablet"
ENDIF
DeviceFlag ← True
Count ← 10
ENDIF
Count ← Count + 1
ENDWHILE
IF DeviceFlag = False
THEN

© UCLES 2020 Page 5 of 10


2210/21 Cambridge O Level – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

1(c) OUTPUT "Your code doesn’t exist, please


ple
l ase try again"
ENDIF
ENDWHILE
IF DeviceType ← "Phone"
THEN
OUTPUT "Would you like a SIM Card?
Card?
? (Answer
(An
Answ
sw
wer
r Y or
or N)"
INPUT SimRequired
ENDIF

1(d) Any five from 5


• Explanation of finding if more than one device is purchased
dev
evvic
ice
• Explanation of application of device e discount
disc
di scou
sc ount
ou nt
• Explanation of calculating the discount(s) and finding the new price
• Explanation of outputting new total
• Explanation of outputting amount saved
• Explanation of messages used
3$*(

Question Answer
An swer
wer Marks

2 2
True False
Statement
(9) (9)

A structure diagram is a piece of code that is available tthroughout


hrou
rou
o ghout the structure of a program. 9

A structure diagram shows the hierarchy of a system. 9

A structure diagram is another name for an array. 9

A structure diagram shows the relationship between different


differe
rent
nt ccomponents
o ponents of a system.
om 9

Two marks for four correct rows.


One mark for three correct rows.

© UCLES 2020 Page 6 of 10


2210/21 Cambridge O Level – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

3(a) One mark for each correct validation check (max two)) 4
• Range
• Length
• Type
• Check Digit

e.g.
One mark for each correct related purpose (max two)) e.
e g.
spec
pecciffic
• To make sure the data entered falls within a specific i set
et of
of values
valu
va l es
specified
• To make sure the data entered is no longer than specifi ed
d
whether
• To make sure the data entered follows rules related to whethe herr it iis
he s numbers of letters
• To make sure an identification code entered is ge g
genuine
nuine or possible
possiblele

3(b) One mark for correct verification check (max one) 1


• Double (data) entry
• Visual check

3(c) Any two correct statements (max two) e.g. 2


cann
not
o check
• Validation checks if the data entered is possible/it cannot che
h ck if data has been entered correctly.
3$*(

• Verification checks if the data entered matches the data submitted


a su
subm
b itted for entry/ it does not check if data matches set
criteria.

Question Answer
An swer
wer Marks

4(a) Any two correct statements (max two) e.g. 2


• The value of the variable Count begins as 0 …
op ccondition
• … and is incremented by 1 before it is tested by the loop ondition
on
• Count will never be 0 at the end of the loop

© UCLES 2020 Page 7 of 10


2210/21 Cambridge O Level – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

4(b) 4
Count ĸ 0
REPEAT
INPUT Number
IF Number >= 100
THEN
Values[Count] ĸ Number
ENDIF
Count ĸ Count + 1
UNTIL Count = 50

One mark – separate INPUT statement


One mark – IF statement attempted
One mark – IF statement completely correct
One mark – termination of loop updated

4(c) Any two correct statements (max two) e.g. 2


statement/comparison
• Alter the IFstatement/add a second IF statement/compa arison that’s already there …
<=200
0
• … so that additional criteria set an upper limit of <=200
3$*(

© UCLES 2020 Page 8 of 10


2210/22 Cambridge O Level – Mark Scheme May/June 2020
PUBLISHED
Section A

Question Answer Marks

1(a) Forr two variables 4


One mark for identification of a variable with a suitab
tab
able
le
suitableed a a ty
at
data ype
p a
type and
nd one mark for its use

Variable hourArrived
Data type integer
Use to calculate the price based on the
e number
numb
nu m er of
of hours
hour
ho u s parking

Variable priceToPay
Data type real
Use store result of price
e calculation
calc
calcul
lc ulat
ul atio
at ion
io n

Many correct answers, these are examples only.

1(b) Forr each validation check 4


justtif
ific
icat
ic atio
at
One mark for identification of a check and one mark for the justification i n
io

Day
3$*(

Check presence check


Justification need to enter day to be able to calculate price

Hour
Check range check
Justification need to check hour is between 8 and 23

Many correct answers, these are examples only.

© UCLES 2020 Page 4 of 8


2210/22 Cambridge O Level – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

1(c) Any fourr from: 4


• All 5 digits input
weiigh
ght
• Each of the first 4 digits is multiplied by a weightht based
base
ba s d on
se n its position
• Specific method of individualising the digits t described
ts des
escr
crib
cr ibed
ib ed
• Added together divided by 11
• Remainder used to calculate correct 5th digitdigit
git
• Checked against 5th digit input
• If the same, then valid

1(d) Any fourr from: 4


• Input amount
equal
equa
• Check amount greater than or eqqua
uall to tthe
h p
he price
rice
ri c tto
ce o pa
payy …
• … True – add amount to daily total
• … False – ask for payment to be re-entered
• … Until valid amount input
Sample answer
PRINT "Please Enter Payment"
INPUT amount
WHILE amount < priceToPay DO
3$*(

PRINT "Insufficient payment, please enter ente


t r new
n w Payment"
ne
INPUT amount
ENDWHILE
totalPayment ← totalPayment + amount

1(e) Explanation 4
Any fourr from:
• Add number of hours selected to arrival hour
• Check if this is greater than 16
• True – calculate price up to 16 …
• … using current price in force
• … and add in evening charge
• False – calculate price as usual

explained.
Programming statements can be used but must be exp
pla
lained.

© UCLES 2020 Page 5 of 8


2210/22 Cambridge O Level – Mark Scheme May/June 2020
PUBLISHED
Section B

Question Answer Marks

2 Real 5
Integer
Char/String
String
Boolean

Question Answer Marks

3(a) One mark for error and correction 4


Line 1 HighestMark ← 0
Line 7 INPUT Mark[Count]
HighestMarkStudents
Line 10 HighestMarkStudents ← HighestMarkStudents s + 1
Line 14 HighestMark ← Mark[Count]

3(b) Any six from: 6


3$*(

Add variable LowestMark …


… Set this to a high value for example 100
Add variable LowestMarkStudents …
… Set this to zero
Check iff Mark[Count] = LowestMark …
… True – add 1 to LowestMarkStudents
Check iff Mark[Count] < LowestMark …
LowestMark
Mark
… True – set LowestMarkStudenta to 1 and set LowestMa rk to Mark[Count]
Add extra output statement

© UCLES 2020 Page 6 of 8


2210/22 Cambridge O Level – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

5 One mark for explanation of dimension 3


One mark for explanation of index
One mark for inclusion of an example

The dimension is the number of indexes required to oa ccces


cces
ess an e
access leme
le m nt.
element.
The index is the position of the element in an array
one-dimen
ensi
s on
si
For example A[25] is the 25th element of a one-dimensionalonal
al arr
rray
ray
a .
a array.

Question Answer Marks

6(a) One mark for field and one mark for reas
reason
asson 2
Field Juice code
Reason only unique identifier

6(b) 4
Field: Fruit 1 Fruit 2 Size Stock level

Table: JUICE JUICE JUICE JUICE


3$*(

Sort:

Show: † † ; ;

Criteria: ="Apple" ="Apple"

or:

One mark for each correct column

© UCLES 2020 Page 8 of 8


2210/02 Cambridge O Level – Mark Scheme For examination
SPECIMEN from 2023

Question Answer Marks


1(a) One mark for each correct line. 4

Pseudocode description P
Ps
Pseudocode
eudocode statement

FOR…TO…NEXT

a loop that will always iterate at


least once

IF…THEN…ELSE…ENDIF
IF …T
THE
HEN…
N ELSE…ENDIF

a conditional statement to deal


with many possible outcomes

WHILE…DO…ENDWHILE
WHIL
WH I E…DO…ENDWHILE

a loop that will always iterate a set


number of times

CASE…OF…OTHERWISE…ENDCASE
CASE
SE
E…O
…OF…
OF OTHERWISE…ENDCASE
3$*(

a conditional statement with


different outcomes for true and false

REPEAT…UNTIL
R
RE PEAT…UNTIL

© UCLES 2020 Page 4 of 16


2210/02 Cambridge O Level – Mark Scheme For examination
SPECIMEN from 2023

Question Answer Marks


1(b) x appropriate loop controls 3
x read from array
x output from array (the last two points can be in one
one tate
tat ment
ent
n , see example)
n sstatement,

sam
ame
am
Note: reading and the output MUST be within the same lo
oop
o .
e loop.

For example:
Count m 0
WHILE Count < 50 DO
OUTPUT Name[Count]
Count m Count + 1
ENDWHILE

Question An swer
wer
e
Answer Marks
2 Validation check 4

One mark for description:


x e sible.
en
To test if the data entered is possible / reasonable / ssensible.
3$*(

x spec
A range check tests that data entered fits within specified valu
lues
ues
e .
eccifified values.

One mark for example:


x Allow any correct validation check as an example (ra
ra
ang
n e, len
(range, ngth
gtth, type, presence, format, etc.).
length,

Verification check

One mark for description:


x To test if the data input is the same as the data that wa inten
as
was nde
ded
intended d to be input.
x A double entry check expects each item of data to be b entered w ce
wi c and compares both entries to check they are the
d ttwice
same.

One mark for example:


a , double
al
Allow any correct verification check as an example (visual
(visual, ee ntry
nt
tr , etc.).
entry,

© UCLES 2020 Page 5 of 16


2210/02 Cambridge O Level – Mark Scheme For examination
SPECIMEN from 2023

Question Answer Marks


3 B 1

Question Answer
An sw
weerr Marks
4 One mark for a hierarchical structure. 4
One mark for suitable names for the sub-systems.
One mark for identifiable inputs.
One mark for identifiable outputs.

For example:

Satellite
Sate
tellllititite
enna
navigation
avi
viga
gatit on
on ssystem
yysste
t m

Input destination Output directions


3$*(

New destination Saved destination Map


M
Ma p List

Question Answer
Answ
wer
e Marks
5(a) One mark for each error identified and correction: 4
x Numbers should be Number
x IF Number > 100 should be IF Number >= 100 00 0
x INPUT Number is missing from inside the loop, inse ert INPUT
insert Nu
umb
T Number
m er after the ENDIF statement.
x The final OUTPUT Number is not needed, remove it. t
t.
5(b) inequality
One mark for both ends of the range and correct inequ allitity symbols.
ty symbol
o s. 2
One mark for the AND // nested IFs.
The test should be IF Number >= 100 AND Number <= < 200200
0

© UCLES 2020 Page 6 of 16


2210/02 Cambridge O Level – Mark Scheme For examination
SPECIMEN from 2023

Question Answer Marks


7(a) Flag Count Name[1] Name[2] Name[
Name[3]
e[
[3]
3 Name[4] Temp 5

Jamal Amir Eve Tara


T ra
Tar
0 1 Amir Jamal
Jama l Eve
Eve
e Tara
Tara
Tara Jamal
1 2 Amir Eve Jamal
Jam
amal
amal
l Tara
Tara
ra Jamal
1 3 Amir Eve Jamal
J amal
mal
a Tara
T ra
Tara Jamal
1 4 Amir Eve Jamal
Jamal
l Tara
T ra
Ta Jamal
0 1 Amir Eve Jamal Tara
Tara
a Jamal
0 2 Amir Eve Jamal Tara Jamal
J mal
Ja
0 3 Amir Eve
Ev
ve Jamal
Jam
amal
al Tara
Tar
Tara
a Jamal
Jama
Jam l
0 4 Amir Eve Jamal
l Tara
Ta
ara Jamal

One mark for Flag column.


One mark for Count column.
One mark for Temp column.
Two marks for all correct Name columns or one mark forr tw three
two or thr
hree
hr ee ccorrect
orrect Name columns.
3$*(

Note: Repeated values do not need to be written unless a value iss rrewritten.
ewritten.
ew
w
7(b) x bubble sort / sorting the names 2
x eti
ascending order / A to Z / lowest to highest / alphabe tical orde
alphabetical de
er
order

Question Answer
An swer
wer Marks
8 One mark for each. 3

10.00௕ERXQGDU\DEQRUPDOGDWDWKHSULFHVKRXOGEHUH
0
10.00௕ERXQGDU\DEQRUPDOGDWDWKHSULFHVKRXOGEHUHMHFWHGYDOXHLVRXWRIUDQJH
UHMH
UH MHFWHGYDO
MH DOXH
X LVRXWRIUDQJH
9.99௕௕ERXQGDU\H[WUHPHQRUPDOGDWDWKH
9.99௕௕ERXQGDU\H[WUHPHQRUPDOGDWDWKHSULFHVKRXOGEHDFFHSWHGYDOXHLVZLWKLQQRUPDOUDQJH
SULFHVKRRXO
X G EHDFF
F HSW
FF S HGYDOXHLVZLWKLQQRUPDOUDQJH
ten௕௕௕DEQRUPDOGDWDLQSXWVKRXOGEHUHMHFWHGYDO
ten௕௕௕DEQRUPDOGDWDLQSXWVKRXOGEHUHMHFWHGYDOXHLVZURQJW\SH
XH
H LV
V ZURQJJ W\S\SHH

© UCLES 2020 Page 8 of 16


2210/02 Cambridge O Level – Mark Scheme For examination
SPECIMEN from 2023

Question Answer Marks


13 FOR StudentCounter m 1 to ClassSize
FOR SubjectCounter m 1 to SubjectNo
TotalMark[StudentCounter] m TotalMaMark
Mar [[S
Stu
t deent
TotalMark[StudentCounter]
n Counter] + StudentMark[StudentCounter,
SubjectCounter]
NEXT SubjectCounter
AverageMark[StudentCounter] m INT(( Tota
ota
t lMMar
ark[
k[St
St
tud
INT((TotalMark[StudentCounter]
u entCounter] / SubjectNo) + 0.5)
StudentName[StudentCouunt
nter
ter
OUTPUT "Name ", StudentName[StudentCounter]r]
TotalMark
rk[S
rk
k[S
[ tu
tude
d ntCounter]
de Co
o
OUTPUT "Combined total mark ", TotalMark[StudentCounter]
AverageMark[StudenentC
en t ount
nter
nt
OUTPUT "Average mark ", AverageMark[StudentCounter] er]
er]
IF AverageMark[StudentCounter] >= Distinction
THEN
DistinctionNo m DistinctionNo + 1
OUTPUT "Grade Distinction"
ELSE
Me
eri
r t
IF AverageMark[StudentCounter] >= Merit
THEN
MeritNo m MeritNo + 1
OUTPUT "Grade Merit"
ELSE
3$*(

IF AverageMark[StudentCounter] >= Pass


>= Passs
THEN
PassNo m PassNo + 1
OUTPUT "Grade Pass"
ELSE
FailNo m FailNo + 1
OUTPUT "Grade Fail"
ENDIF
ENDIF
ENDIF
NEXT StudentCounter

OUTPUT "Number of Distinct


tio
i nNo
Distinctions ", DistinctionNo
OUTPUT "Number of Merits ", MeritNo
OUTPUT "Number of Passes ", PassNo
OUTPUT "Number of Fails ", FailNo

© UCLES 2020 Page 13 of 16

You might also like