Past-paper question · 2025 October-November · Paper 21 · Q6(a)

Question 6(a) 2025 · October-November · Paper 21 · 4 marks

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

Official answer for Question 6

Part (a)

✓
One mark for each line identified and the correction:

Question 4

✓
Line 03 –
✓
should be
✓
DECLARE CheckDigit : INTEGER
✓
Line 05 –
✓
should be
✓
FOR Count 1 TO 5
✓
Line 08 –
✓
should be
✓
Total Total + (Digit * Count)
✓
Line 15 –
✓
should be
✓
OUTPUT "The check digit is ", CheckDigit

Mark scheme 0478_w25_ms_21.pdf →

Show text version of question

Question 6

Part (a)

Question 6

A check digit is one method to validate a 5-digit number.

The check digit for a 5-digit number is calculated as follows:

  • Each digit is multiplied by its position (the first digit on the left is in position 1).
  • The result of each multiplication is totalled.
  • MOD(Total, 11) is used to calculate the check digit.
  • If the result of the MOD function is 10, the check digit is ‘X’.

For example:

The calculation of the check digit for the 5-digit number 30475 is as follows:

Multiply each digit by its position and total the results:

(3 * 1) + (0 * 2) + (4 * 3) + (7 * 4) + (5 * 5) = 68

Calculate the check digit with MOD(Total, 11)

MOD(68, 11) = 2

The check digit for 30475 is 2

This pseudocode algorithm should calculate and output the check digit of a 5-digit number:

01 DECLARE Total : INTEGER 02 DECLARE Digit : INTEGER 03 DECLARE CheckDigit : CHAR 04 Total 0 05 FOR Count 1 TO 10 06 OUTPUT "Please enter digit ", Count 07 INPUT Digit 08 Total Total + (Digit / Count) 09 NEXT Count 10 CheckDigit MOD(Total, 11) 11 IF CheckDigit = 10

12 THEN 13 OUTPUT "The check digit is X" 14 ELSE 15 OUTPUT "The check digit is ", Count

* 0000800000007 * DFD

Question 7

, ,

Part (a)

Identify the line numbers of the four 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 .................................................................................................................................

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

Error 4 line number .........................................

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

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

[4]
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 0478_w25_qp_21.pdf

Keep practising this topic