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

Question 7(a) 2025 · October-November · Paper 23 · 3 marks

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

Official answer for Question 7

Part (a)

✓
One mark for each line identified and corrected

Question 3

✓
Line 02 – should be DECLARE DenaryNumber : INTEGER
✓
Line 05 – should be FOR Count 8 TO 1 STEP -1
✓
Line 06 – should be BinaryArray[Count] MOD(DenaryNumber,2)

Mark scheme 2210_w25_ms_23.pdf →

Show text version of question

Question 7

Part (a)

Question 7

An algorithm has been written in pseudocode to:

  • input a whole number between 1 and 255 inclusive
  • convert the input to an 8-bit binary number
  • store each bit of the binary number in an array.

For example, if the denary number 127 was input, the binary number 01111111 would be stored in the array.

01 DECLARE BinaryArray : ARRAY[1:8] OF INTEGER 02 DECLARE DenaryNumber : CHAR

03 OUTPUT "Please enter a whole number between 1 and 255 inclusive " 04 INPUT DenaryNumber 05 FOR Count 7 TO 1 STEP -1 06 BinaryArray[Count] MOD(DenaryNumber,3) 07 DenaryNumber DIV(DenaryNumber,2) 08 NEXT Count

Part (a)

Identify the line numbers of the three errors in the pseudocode and suggest a correction for

each error.

Error 1 line number ...................................

Correction .................................................................................................................................

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

Error 2 line number ...................................

Correction .................................................................................................................................

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

Error 3 line number ...................................

Correction .................................................................................................................................

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

[3]

* 0000800000009 * DFD

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

Keep practising this topic