Question 4(a)(ii) 2018 · October-November · Paper 21 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (a)
(ii)
Question 1
mark for each mark point:
Question 4
Show text version of question
Question 4
Part (a)
(ii)
Question 4
Part of a program written in pseudocode is shown.
01 DECLARE NumElements : INTEGER
…
10 FUNCTION ScanArray(SearchString : STRING) RETURNS INTEGER
Question 11
12 DECLARE ArrayIndex : INTEGER 13 DECLARE ArrayString : STRING 14 DECLARE NumberFound : INTEGER
Question 15
16 ArrayIndex 0 17 NumberFound 0
Question 18
19 FOR ArrayIndex 1 TO NumElements 20 ArrayString ResultArray[ArrayIndex, 1] 21 IF ArrayString = SearchString 22 THEN 23 CALL SaveToFile(ArrayString) 24 NumberFound NumberFound + 1 25 ENDIF 26 ENDFOR
Question 27
28 RETURN NumberFound
Question 29
30 ENDFUNCTION
(ii)
Describe in detail the purpose of lines 19 to 26 in the function ScanArray().
Do not use pseudocode in your answer.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[4]
Question 11
Why this question appears here
82% assigned-topic match · Programming › Constructs
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9608_w18_qp_21.pdf
