Question 4(a)(i) 2018 · October-November · Paper 22 · 5 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (a)
(i)
Question 5
Question 1
Show text version of question
Question 4
Part (a)
(i)
Question 4
Part of a program written in pseudocode is shown.
010 DECLARE NextArrayElement : INTEGER
…
100 FUNCTION ScanFile(SearchString: STRING) RETURNS INTEGER 101 102 DECLARE FileData : STRING 103 DECLARE FileLine : INTEGER 104 105 NextArrayElement 1 106 FileLine 1 107 FileData ReadFileLine("DataFile.txt", FileLine) 108 109 WHILE FileData <> "" 110 IF LEFT(FileData, 7) = SearchString 111 THEN 112 ResultArray[NextArrayElement] FileData 113 NextArrayElement NextArrayElement + 1 114 ENDIF 115 FileLine FileLine + 1 116 FileData ReadFileLine("DataFile.txt", FileLine) 117 ENDWHILE 118 119 CALL ScanCompleted() 120 RETURN FileLine 121 122 ENDFUNCTION
(i)
Examine the pseudocode. Complete the following table.
Answer
The identifier name of a local variable The identifier name of a user-defined procedure The identifier name of a user-defined function The number of dimensions of ResultArray The scope of FileData
Why this question appears here
92% assigned-topic match · Programming › Structured programming
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_22.pdf
