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

Question 2(a) 2025 · October-November · Paper 23 · 6 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)

✓
One mark per point:

Question 6

Question 1

✓
Open the file in append mode (and subsequently close) before loop

Question 2

✓
Initialise a variable to 1 / 0 before loop

Question 3

✓
Use the variable as an index to the array to access an element in a loop

Question 4

✓
Test if element value is blank / empty in a loop

Question 5

✓
If not blank then write the value to the file in a loop

Question 6

✓
Increment the variable in a loop

Question 7

✓
Repeat from MP3 until variable value is 66 / 65 / all elements (in the
✓
array) have been checked

Mark scheme 9618_w25_ms_23.pdf →

Show text version of question

Question 2

Part (a)

A
program contains a global 1D array of type STRING containing 65 elements.

An existing text file is used to store the data in the array. Only non-blank elements (those that do not contain an empty string) are written to the text file.

An algorithm will:

  • write the first element of the array as a new line in the text file
  • continue until all elements have been written, each to a new line of the text file.

Stepwise refinement is applied to the algorithm.

Describe up to six steps for this algorithm that could be used to produce pseudocode.

Do not use pseudocode statements in your answer.

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

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

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

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

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

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

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

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

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

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

Step 6 .......................................................................................................................................

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

[6]
Topic relevance

Why this question appears here

71% assigned-topic match · Algorithm design and problem-solving › Algorithms

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_w25_qp_23.pdf

Keep practising this topic