Question 2(a) 2022 · February-March · Paper 22 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 2
Part (a)
Question 4
- 100
- AND Age < 12
- Count12to18 + 1
- CountOver18
Show text version of question
Question 2
Part (a)
Question 2
An algorithm has been written to:
- input the ages of 100 students
- count and output the number of students aged 7 and under 12
- count and output the number of students aged 12 and under 18
- count and output the number of students aged 18 and over.
Part (a)
Complete the pseudocode algorithm:
01 Count7to12 0 ← 02 Count12to18 0 ← 03 CountOver18 0 ← 04 FOR Student ← 1 TO ............................................ 05 OUTPUT "Please enter student's age in years " 06 INPUT Age 07 IF Age >= 7 ................................................ 08 THEN 09 Count7to12 Count7to12 + 1 ← 10 ENDIF 11 IF Age >= 12 AND Age < 18 12 THEN 13 Count12to18 ← ......................................... 14 ENDIF 15 IF Age >= 18 16 THEN 17 CountOver18 CountOver18 + 1 ← 18 ENDIF 19 NEXT Student 20 OUTPUT "There are ", Count7to12, " students aged 7 and under 12." 21 OUTPUT "There are ", Count12to18, " students aged 12 and under 18." 22 OUTPUT "There are ", ................., " students aged 18 and over."
Why this question appears here
98% assigned-topic match · Algorithm design and problem-solving
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_m22_qp_22.pdf
