You are on page 1of 5

THE HONG KONG ASSOCIATION FOR COMPUTER EDUCATION

INFORMATION AND COMMUNICATION TECHNOLOGY


MOCK EXAMINATION 2021

PAPER 2 (D)

MARKING SCHEME

©香 港 電 腦 教 育 學 會 保 留 版 權
The Hong Kong Association for Computer Education
All Rights Reserved 2021

1. a) i) Design, Documentation 2x1

ii) 1: User Acceptance Test 1


2: Unit Test 1

3: System Test 1
iii) High-level programming language is similar to human language, which is easy to code, debug and
maintain 1

Assembly language is a low-level programming language for device drivers OR


It has faster runtime 1

(Or other reasonable answers)


iv) Yes. The system can be developed in a short period of time to cater for rapid change of user
requirement.

OR
No. The system may be unstable with insufficient time. 1

b) i) (A): Product ID

(B): Self-Checkout System


(C): Stock System

(D): Checkout Information


(E): Stock File 5x1
ii) Gantt Chart / Structure Chart / System Flowchart / Flowchart 1

iii) No. User manual describe how the system is operated instead of how the system is created. 1

1
2. a) 57 1

b) i) z  x z  y
x  y OR y  x
y  z x  z 2

ii) for i from 0 to N-1 do


T[i]  A[i] 2

iii) N-2-i 1

T[N-k] 1

iv) Only array T will be sorted, and array A can keep the original content. 1

2
c) i) T[j] 1

(use of SWAP) 1

(All correct) 1
Possible alternative 1: Possible alternative 2:

Points to note:
A mistake is found in the question answer book. The indentation of the answer box on Line 7 is found to be
misplaced during the formatting process. Special arrangement is made accordingly. Sorry for any inconvenience
caused.
Original question:

Original answer box

Original marking:
T[j]

maxIndex  j

swap(T[i], T[maxIndex]) 3x1

(ii) 2

Index 0 1 2 3 4 5 6

Value 85 72 67 57 23 14 2

iii) Line 2: for i from 0 to k-1 do 2

3
3. a) i) True 1

False 1

ii) Any case where the order of brackets are not correct. e.g. 1

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
SEQ ) (

b) i)

(
(
( BOTTOM
S 1
f = True 1

ii) 16 1
iii) Any case where the number of opening brackets is larger than number of closing brackets. e.g. 1

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
SEQ ( ( ( ) )

f 1
isEmpty(S) 1

c) C = '(' or C = '{' or C = '[' 1

C = ')' or C = '}' or C = ']' 1

t  POP(S)
1 mark for POP
if C = ')' and t != '(' then 1 mark for handling of 1 type of
f  False brackets correctly
if C = '}' and t != '{' then 1 mark for handling 3 types of
f  False brackets
if C = ']' and t ≠ '[' then
f  False

not isEmpty(S) 1

4
4. a) LaserOn()
1 mark for LaserOn and LaserOff
for i from x to x+length-1 do
1 mark for nested loop to MoveLH
for j from y to y+length-1 do 1 mark for correct looping parameter
MoveLH(i,j)
LaserOff()

b) Improve the readability / Reuse of codes / Encourage collaboration / Easy to detect programming errors
(Any two) 2x1

c) i) 00100 00200 00300 00400 00500 1

ii) 01020 03330 04050 06660 00000 1

d) width - 1
1
height - 1

Image[i * width + j] 1

e) i) i  index + 1
1 mark for looping through
result  -1 index+1 to the next point
while i < width * height and result = -1 do 1 mark for checking for the
if image[i] = current + 1 then correct sequence number

result  i 1 mark for correctly returning


the index of next point
i  i + 1
1 mark for correctly returning -1
return i

ii) No. Since it is the worst case of Binary Search and best case scenario in linear search. 1

The next point to be cut is always 2 points ahead by Linear search. 1

- End of Marking Scheme -

You might also like