Question 6(b) 2023 · October-November · Paper 21 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 6
Part (b)
Question 4
- Initialisation
- inputting 10 names
- storing the names in an array
- sorting the names in alphabetical order using a bubble sort
- displaying the 10 names
- iteration
Show text version of question
Question 6
Part (b)
Question 6
An algorithm has been written in pseudocode.
01 DECLARE A[1:10] : STRING 02 DECLARE T : STRING 03 DECLARE C, L : INTEGER 04 L 10 05 FOR C 1 TO L 06 OUTPUT "Please enter name " 07 INPUT A[C] 08 NEXT C 09 FOR C 1 TO L 10 FOR L 1 TO 9 11 IF A[L] > A[L + 1] 12 THEN 13 T A[L] 14 A[L] A[L + 1] 15 A[L + 1] T 16 ENDIF 17 NEXT L 18 NEXT C 19 FOR C 1 TO L 20 OUTPUT "Name ", C, " is ", A[C] 21 NEXT C
Part (b)
State four processes in this algorithm.
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
4 ................................................................................................................................................
...................................................................................................................................................
Why this question appears here
60% assigned-topic match · Programming › Programming concepts
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 0478_w23_qp_21.pdf
