Computer Science · Oct / Nov 2025 · Paper 21 · Question 6
0478
As printed in the paper
The question as text
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. • |npx ¡¡¢ 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 |npx ¡¡¢ |np§¨ ¡¡¢ © ª The check digit for 30475 is 2 This pseudocode algorithm should calculate and output the check digit of a 5-digit number: «¡ pqu¬oq x ® wxq¯qo «ª pqu¬oq p°±° ® wxq¯qo «² pqu¬oq u³´µ¶p°±° ® uzo «· x « «¸ }no u¹º ¡ xn ¡« «§ nvx»vx ¼»´½´ ´º´¾ ¿°±° ¼ u¹º «À w»vx p°±° «¨ x x Á p°±° u¹º¢ «Â wqÃx u¹º ¡« u³´µ¶p°±° |npx ¡¡¢ ¡¡ } u³´µ¶p°±° © ¡« ¡ª xzqw ¡² nvx»vx ¼x³´ µ³´µ¶ ¿°±° °½ ü ¡· q¬{q ¡¸ nvx»vx ¼x³´ µ³´µ¶ ¿°±° °½ ¼ u¹º ¡§ qwp}
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
6(a)[4]
One mark for each line identified and the correction:
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
6(b)[3]
One mark per bullet point, Max 3
After the for loop but before the total/after line 07use a suitable loop (repeat/while)… checking digit is 0 to 9re-input digit in the loop6(c)[2]
One mark for identification and one mark for correct description for each:
visual check… look at the data that has been entered and confirm it matchesdouble entry… enter data twice and only accept identical values
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

