Note AcademyNote Academy

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. • |np›xœžŸ ¡¡¢ 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 |np›xœžŸ ¡¡¢ |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°±° ® uz­o «· xœžŸ « «¸ }no uœ¹º ¡ xn ¡« «§ nvx»vx ¼»Ÿ´ž½´ ´º´¾ ¿°±° ¼ uœ¹º «À Šw»vx p°±° «¨ xœžŸ xœžŸ Á ›p°±° ˆ uœ¹º¢ «Â wqÃx uœ¹º ¡« u³´µ¶p°±° |np›xœžŸ ¡¡¢ ¡¡ Š} 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 07
    use a suitable loop (repeat/while)
    … checking digit is 0 to 9
    re-input digit in the loop
  • 6(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 matches
    double 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.