Question 4(d)(ii) 2018 · October-November · Paper 23 · 1 mark
Reveal official mark-scheme answer
Official answer for Question 4
Part (d)
(ii)
Question 1
Show text version of question
Question 4
Part (d)
(ii)
Question 4
Part of a program written in pseudocode is shown.
010 DECLARE ThisArray : ARRAY [1:100, 1:10] OF STRING 011 DECLARE LastElement : INTEGER
… 100 FUNCTION Update(NewData : STRING) RETURNS INTEGER 101 DECLARE ArrayIndex : INTEGER 102 DECLARE Found : BOOLEAN 103 104 ArrayIndex 1 105 Found FALSE 106 107 WHILE ArrayIndex <= LastElement AND Found = FALSE 108 IF ThisArray[ArrayIndex, 1] > NewData 109 THEN 110 Found TRUE 111 ELSE 112 ArrayIndex ArrayIndex + 1 113 ENDIF 114 ENDWHILE 115 116 IF Found = TRUE 117 THEN 118 CALL Insert(ArrayIndex, NewData) 119 ELSE 120 ArrayIndex 0 121 ENDIF 122 123 RETURN ArrayIndex 124 ENDFUNCTION
(ii)
A programmer decides to declare LastElement as a constant instead of a variable.
Write a statement in pseudocode to declare LastElement as the value 200.
.......................................................................................................................................[1]
Question 13
Question 5 begins on the next page.
Question 14
Why this question appears here
71% assigned-topic match · Programming › Programming basics
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_23.pdf
