Past-paper question · 2022 October-November · Paper 23 · Q2(a)

Question 2(a) 2022 · October-November · Paper 23 · 6 marks

Original past-paper question for 2(A)
Original past-paper question for 2(A)
Reveal official mark-scheme answer Official mark-scheme answer for 2(A)

Official answer for Question 2

Part (a)

✓
One mark per mark point in the correct position, max six

Question 6

✓
•
✓
line 01

Question 50

✓
•
✓
line 08
✓
Value > 50
✓
•
✓
line 12
✓
Reading[Value] + 1
✓
•
✓
line 18
✓
INPUT Value
✓
•
✓
line 23
✓
Reading[Count]
✓
•
✓
line 24
✓
Count + 1

Mark scheme 2210_w22_ms_23.pdf →

Show text version of question

Question 2

Part (a)

Question 2

An algorithm has been written to:

  • set all 50 elements of the array Reading[1:50] to zero
  • input values between 35 and 50 inclusive
  • end the process when an input of –1 is made or 50 valid numbers have been entered
  • reject all other values
  • count the number of times each valid value is input
  • output the number of times each value has been input, starting with the lowest value.

Part (a)

Complete the pseudocode algorithm:

01 FOR Count 1 TO ....................................................................................................

02 Reading[Count] 0

03 NEXT Count

04 Count 1

05 OUTPUT "Please enter next reading "

06 INPUT Value

07 REPEAT

08 IF Value < 35 OR .................................................................................................

09 THEN

10 OUTPUT "Reading out of range"

11 ELSE

12 Reading[Value] .......................................................................................

13 Count = Count + 1

14 ENDIF

15 IF Count <= 50

16 THEN

17 OUTPUT "Please enter next reading "

18 .................................................................................................................................

19 ENDIF

20 UNTIL Value = -1 OR Count > 50

21 Count 35

22 REPEAT

23 OUTPUT "There are ", ....................................................................., " readings of ", Count

24 Count ...................................................................................................................

25 UNTIL Count > 50

[6]

Question 9

Topic relevance

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 2210_w22_qp_23.pdf

Keep practising this topic