Students are learning about a simple check digit method for data validation. In this method, a single check digit is appended to the end of an original number to give a new number. The students are studying a method which: calculates the sum of all the digits in the original number uses integer division to calculate the remainder when the sum is divided by 10 uses the remainder as the check digit appends the check digit to the original number, creating the new number. For example: original number 4162 sum of all digits 4+1+6+ 2 = 13 remainder when the sum is divided by 10 using integer division 3 new number 41623 The method described can be used to detect single-digit errors. For example, if the new number is incorrectly input as 41633, then the check digit does not match and the input will be rejected.
- (a)An incorrect attempt was made to enter 41623. The first two digits were entered incorrectly; the last three digits were entered correctly. When this number was tested, the check digit was found to be correct and the input was accepted. Identify an example of the incorrect attempt to enter 41623 and explain why this number would not be rejected. Number Explanation[2]
- (b)A module Generate() will take an integer value representing an original number and return an integer value representing a new number which includes the check digit. The original number is always at least three digits in length. Write pseudocode for the module Generate() Assume that the parameter is valid.[7]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2025). The mark or mark type is shown in brackets.
- [2] (a) Number: Any number where the first two digits sum to 5 / 15 and the last three digits are 623
- [2] (a) Explanation: The remainder is the same / 3 // The sum of the (first four) digits is the same / 13
- [7] (b) Function heading, parameters return type and ending
- [7] (b) Initialise Total
- [7] (b) Convert Number to a string and loop for length of converted Number
- [7] (b) attempt to form sum of digits in a loop
- [7] (b) completely correct sum of digits in a loop
- [7] (b) Calculate CheckDigit
- [7] (b) Add CheckDigit to original number multiplied by 10 and return number // Convert CheckDigit to a character and appended to NumString and then convert to a number and return
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →