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

Question 2(b) 2022 · October-November · Paper 23 · 3 marks

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

Official answer for Question 2

Part (b)

✓
One mark per place in code and action, max three

Question 3

  • line 21 set Count to 50 / Count 50
  • line 24 subtract 1 from Count / Count Count –1
  • line 25 check for Count equal to 34 / check for Count less than 35 / UNTIL Count = 34 / UNTIL Count < 35
✓
or
✓
One mark per place in code and action, max three
✓
•
✓
line 21 set up FOR loop stating at 50 and finishing at 35 / FOR Count 50 TO 35 STEP –1
✓
•
✓
Remove lines 22 and 24
✓
•
✓
line 25 End FOR loop / NEXT Count
✓
Examples
✓
21 Count 50
✓
22 REPEAT
✓
23 OUTPUT "There are ", Reading[Count], " readings, " of ", Count
✓
24 Count Count –1
✓
25 UNTIL Count = 34
✓
21 FOR Count 50 TO 35 STEP –1
✓
23 OUTPUT "There are ", Reading[Count], " readings, " of ", Count
✓
25 NEXT Count
✓
Cambridge O Level – Mark Scheme
✓
2210/23
✓
October/November 2022
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks
✓
•

Mark scheme 2210_w22_ms_23.pdf →

Show text version of question

Question 2

Part (b)

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 (b)

Describe how the algorithm could be changed to output the number of times each value has

been input, starting with the highest value.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................

[3]

Question 10

Topic relevance

Why this question appears here

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

Keep practising this topic