Past-paper question · 2023 October-November · Paper 21 · Q2(a)

Question 2(a) 2023 · October-November · Paper 21 · 5 marks

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)

Question 5

✓
MP1
✓
Set total to zero
✓
MP2
✓
Input a number
✓
MP3
✓
Check if number greater than 29 and less than 71
✓
… if check is true - add number to total
✓
MP4
✓
MP5
✓
Repeat from step 2 99 times // for a total of 100 iterations
✓
MP6
✓
Output the total

Mark scheme 9618_w23_ms_21.pdf →

Show text version of question

Question 2

Part (a)

An algorithm is expressed as follows:

  • input 100 numbers, one at a time
  • keep a total of all numbers input that have a value between 30 and 70 inclusive and

output this total after the last number has been input.

Outline, using stepwise refinement, the five steps for this algorithm which could be used to produce pseudocode.

Do not use pseudocode statements in your answer.

Step 1 .......................................................................................................................................

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

Step 2 .......................................................................................................................................

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

Step 3 .......................................................................................................................................

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

Step 4 .......................................................................................................................................

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

Step 5 .......................................................................................................................................

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

[5]
Topic relevance

Why this question appears here

82% 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 9618_w23_qp_21.pdf

Keep practising this topic