← IGCSE Computer Science Paper 1

Check digit

An extra digit added to the end of a number, calculated from its other digits. It is recalculated on entry and compared, to detect data entry mistakes.

Understanding Check digit in IGCSE Computer Science Paper 1

What it does: The check digit is the result of a calculation on the other digits, so it depends on them. The comparison of the recalculated value with the typed check digit decides whether the entry is rejected. Check digits are used when data is typed in or scanned. Parity bits, checksums and ARQ are used for transmission errors. A mismatch means the number has probably been entered wrongly, so the system asks the user to enter it again. The check digit is added to the end of the number, for example the last digit of an ISBN-13. Because it is calculated from the other digits, the system can recalculate it and compare it on entry.

Common mistakes: The check digit is calculated from all the other digits. The line overwrites total each time, so only the last digit is used. It should add each digit: total ← total + digit[i]. On entry the check digit is recalculated and compared with the one typed. The number is accepted only when they match, so the test should be IF given = calc THEN.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 168–178) and word search (Modules 168–188).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
What is a check digit?
An extra digit added to the end of a number, calculated from its other digitsA digit that is chosen at random and added to the front of a number
Matches
A check digit is used to detect errors in data sent across a network
↓
A check digit detects data entry errors made by a person typing or scanning, not errors in transmission
Applying
Meanings
Term
check digit
Meaning
An extra digit added to the end of a number, calculated from its other digits. It is recalculated on entry and compared, to detect data entry mistakes.
Practice
Total ← D1 * 4 + D2 * 3 + D3 * 2
Testing
Gaps
check <- total 10
Check Answer
Spots
2FOR i ← 1 TO 4
3 total ← digit[i]

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Butterfly' badge — Branch Hopper, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. What is a check digit?
A. A digit that is chosen at random and added to the front of a number
B. An extra digit added to the end of a number, calculated from its other digits ✓
A check digit is worked out from the other digits using a calculation, so it can be recalculated later and compared.
2. How is the check digit worked out?
A. It is calculated from the other digits of the number ✓
B. It is typed in by the user as any digit they like
The check digit comes from a calculation on the other digits. That is why the computer can recalculate it.
3. A number is typed in with its check digit. What does the computer do next?
A. Recalculates the check digit from the other digits and compares it with the one entered ✓
B. Sends the number back to the user to ask if it is right
The recalculated check digit is compared with the entered one. If they differ, the number was probably entered wrongly.
4. What is a check digit mainly used to detect?
A. Data entry errors, such as a mistyped digit ✓
B. Errors caused by interference during data transmission
Check digits are used when data is typed in or scanned. Parity bits, checksums and ARQ are used for transmission errors.
5. The recalculated check digit does NOT match the one that was entered. What does this suggest?
A. The number is definitely correct
B. A mistake was probably made when the number was entered ✓
A mismatch means the number has probably been entered wrongly, so the system asks the user to enter it again.

Match the Pairs

check digit → An extra digit added to the end of a number, calculated from the other digits, to detect data entry mistakes
recalculate and compare → On entry, the system works out the check digit again from the other digits and compares it with the one typed
The check digit is calculated from the other digits of the number → number = 978030640615 -> check digit = calc(number)
On entry, the check digit is recalculated and compared with the one typed → IF calc(first digits) <> last digit THEN reject
A check digit is used to detect errors in data sent across a network → A check digit detects data entry errors made by a person typing or scanning, not errors in transmission
The check digit is chosen at random and put at the start of the number → The check digit is calculated from the other digits and added to the end of the number, not chosen randomly

Key Term

check digit
An extra digit added to the end of a number, calculated from its other digits. It is recalculated on entry and compared, to detect data entry mistakes.

Fill in the Blanks

1. total <- digit1 + digit2 + digit3 check <- total MOD 10
Hint: Type the operator that gives the remainder after division.
2. IF newCheck = enteredCheck THEN OUTPUT "Number accepted" ENDIF
Hint: Type the comparison operator that tests whether the recalculated check digit matches the one entered.
3. IF newCheck <> enteredCheck THEN OUTPUT "Check digit error" ENDIF
Hint: Type the keyword that starts the code run when the two check digits differ.
4. remainder <- total MOD 11 checkDigit <- 11 - remainder
Hint: Type the variable from the line above that holds the leftover after dividing.
5. IF newCheck <> enteredCheck THEN OUTPUT "Please re-enter the number" ENDIF
Hint: Type the command that shows a message to the user when a data entry mistake is found.

Spot the Error

Question 1
A total ← 0
B FOR i ← 1 TO 4
C total ← digit[i]
D NEXT i
E check ← total MOD 10
Line C — The check digit is calculated from all the other digits. The line overwrites total each time, so only the last digit is used. It should add each digit: total ← total + digit[i].
Question 2
A INPUT number
B given ← LastDigit(number)
C rest ← AllButLast(number)
D IF given <> calc THEN
E IF given = calc THEN
F OUTPUT "Accepted"
Line D — On entry the check digit is recalculated and compared with the one typed. The number is accepted only when they match, so the test should be IF given = calc THEN.
Question 3
A total ← d1*4 + d2*3
B total ← total + d3*2
C remainder ← total DIV 11
D check ← 11 - remainder
Line C — Modulus 11 needs the remainder after dividing by 11, which is MOD. DIV gives the whole-number quotient. It should be remainder ← total MOD 11.
Question 4
A total ← d1 + d2 + d3 + check
B check ← total MOD 10
C full ← number & check
Line A — The check digit is calculated from the other digits of the number, so it cannot be used in its own calculation. The total should be d1 + d2 + d3 + d4.
Question 5
A remainder ← total MOD 11
B check ← remainder - 11
C IF check = 10 THEN
D check ← "X"
Line B — In this weighted modulus 11 method the check digit is 11 minus the remainder. Writing remainder - 11 gives a negative number. It should be check ← 11 - remainder.

Student with a class code? Join your class →