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

Question 6(b) 2025 · October-November · Paper 21 · 3 marks

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

Official answer for Question 6

Part (b)

✓
One mark per bullet point, Max 3

Question 3

✓
•
✓
After the for loop but before the total/after line 07
✓
•
✓
use a suitable loop (repeat/while)
✓
•
✓
… checking digit is 0 to 9
✓
•
✓
re-input digit in the loop

Mark scheme 0478_w25_ms_21.pdf →

Show text version of question

Question 6

Part (b)

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

Explain how you could modify the pseudocode to validate that each input is a single digit.

Any code must be fully explained.

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

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

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

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

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

[3]
Topic relevance

Why this question appears here

99% 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 0478_w25_qp_21.pdf

Keep practising this topic