A parcel depot uses a checksum algorithm before it accepts a tracking number. Fig. 1 shows the pseudocode. The program adds the first five digits, calculate...

Assessment: Computer Science 4CP0 | Paper 2 Mock 01 | Written Paper 2 Subject: Computer Science - 4CP0

Question 1 Report

A parcel depot uses a checksum algorithm before it accepts a tracking number. Fig. 1 shows the pseudocode. The program adds the first five digits, calculates the remainder after division by 10, then compares that result with the final digit. A number is accepted only when both values are the same. The code is used to identify typing errors before parcel data are added to the main file.

Fig. 1: tracking-number check01 total ← digit1 + digit2 + digit3 + digit4 + digit502 check ← total MOD 1003 IF check = digit6 THEN04 DISPLAY "accepted"05 ELSE DISPLAY "error"

A driver enters the number 482736.
(a) Identify the value of total. [1]
(b) Write the value of check. [1]
(c) State the program output for this number. [1]
(d) Give the final digit that would make 48273 a correct tracking number. [1]

Answer Details

(a) Add the first five digits:

\[4+8+2+7+3=24\]

Therefore total is 24. [1]

(b) MOD 10 gives the remainder after division by 10:

\[24\operatorname{MOD}10=4\]

So check is 4. [1]

(c) The final entered digit is 6, but the calculated check digit is 4. They are not equal, so the output is error. [1]

(d) To make 48273 correct, its final digit must be 4. [1]

Download The App On Google Playstore

Everything you need to excel in your exams

Green Bridge CBT Mobile App
Personalized AI Learning Chat Assistant
200,000+ Exam Questions Across IGCSE, JAMB, WAEC & NECO
Over 3,900 Lesson Notes
Offline Support - Learn Anytime, Anywhere
Green Bridge Timetable
Literature Summaries & Potential Questions
Track Your Performance & Progress
In-depth Explanations for Comprehensive Learning