HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /A delivery company adds a check digit to each parcel number…
MediumComputer ScienceHigh School (9–10)Computer Science › Algorithms and Problem-SolvingNumericalIGCSE

A delivery company adds a check digit to each parcel number…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

A delivery company adds a check digit to each parcel number. Each digit is multiplied by a weight, 111 and 333 in turn starting with 111, and the products are added. The check digit makes the total a multiple of 101010.

  1. Find the check digit for the parcel number 7,2,5,8,3,17, 2, 5, 8, 3, 17,2,5,8,3,1.
  1. A clerk types the number with the 555 and the 888 swapped. Show that the check digit catches the mistake.

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

Validation checks that data is sensible: range, length, type, presence and format checks, and a check digit. Verification checks that data was entered as intended: a visual check and a double entry check. A validation loop repeats the input, with an error message, until the data is acceptable.

The worked solution

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Step 1. The weighted sum. 7×1+2×3+5×1+8×3+3×1+1×3=7+6+5+24+3+3=487 \times 1 + 2 \times 3 + 5 \times 1 + 8 \times 3 + 3 \times 1 + 1 \times 3 = 7 + 6 + 5 + 24 + 3 + 3 = 487×1+2×3+5×1+8×3+3×1+1×3=7+6+5+24+3+3=48.

Step 2. The check digit. The next multiple of 101010 is 505050, and 48+2=5048 + 2 = 5048+2=50. So the check digit is 222, and the full number is 725831272583127258312.

Step 3. The swapped digits. For 7,2,8,5,3,17, 2, 8, 5, 3, 17,2,8,5,3,1 the sum is 7+6+8+15+3+3=427 + 6 + 8 + 15 + 3 + 3 = 427+6+8+15+3+3=42. The check digit for this would be 888, not 222. The computer works out 888, compares it with the 222 that was typed, and rejects the number.

Answer: (a) the weighted sum is 484848 and the check digit is 222; (b) the swapped number gives a sum of 424242 and a check digit of 888, which does not match.

Why it works. The 555 and the 888 have different weights, so swapping them changes the sum by 2×(8−5)=62 \times (8 - 5) = 62×(8−5)=6.

Log in to save this for later
← All Problems
← Name the check in each case. Say whether it is validation or verification…This is the kind of long scenario question that ends Paper 2… →
More onComputer Science › Algorithms and Problem-Solving

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Validation and verificationStandard Algorithms: Totals, Searching, Sorting and Validation

More on this topic

  1. This is the kind of long scenario question that ends Paper 2…Hard
  2. Name the check in each case. Say whether it is validation or verification…Easy
  3. A bubble sort is changed so that it sorts in descending order: the comparison becomes IF…Hard
A shop stores the colours of the ten bicycles in its window in an array Colours: red, blue, red…Medium
  • A bubble sort puts the scores 5, 1, 4, 2, 8 into ascending order…Medium
  • All problems on this topic →