Question 4(b)(ii) 2019 · May-June · Paper 42 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (b)
(ii)
Question 1
mark per bullet point
Question 3
Show text version of question
Question 4
Part (b)
(ii)
The following is an example of a sorting algorithm. It sorts the data in the array ArrayData.
01 TempValue "" 02 REPEAT 03 Sorted TRUE 04 FOR Count 0 TO 4 05 IF ArrayData[Count] > ArrayData[Count + 1] 06 THEN 07 TempValue ArrayData[Count + 1] 08 ArrayData[Count + 1] ArrayData[Count] 09 ArrayData[Count] TempValue 10 Sorted FALSE 11 ENDIF 12 ENDFOR 13 UNTIL Sorted = TRUE
(ii)
Rewrite lines 4 to 12 of the algorithm in part
Part (b)
using a WHILE loop instead of a FOR
loop.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.....................................................................................................................................
Why this question appears here
71% 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_s19_qp_42.pdf
