Question: CCreate the parity bits using the Luhn Algorithm to pre - check the validity of a credit card number. From the rightmost digit, which is

CCreate the parity bits using the Luhn Algorithm to pre-check the validity of a credit card number.
From the rightmost digit, which is the check digit, moving left, double the value of every second digit; if the product of this doubling operation is greater than 9(e.g.,7*2=14), then sum the digits of the products (e.g.,10: 1+0=1,14: 1+4=5).
Take the sum of all the digits. If the total moduloLinks to an external site. 10 is equal to 0(if the total ends in zero) then the number is valid according to the Luhn formula; else it is not valid.
Assume an example of an account number "7992739871" that will have a check digit added, making it of the form 7992739871x:
Account number
7
9
9
2
7
3
9
8
7
1
x
Double every other
7
18
9
4
7
6
9
16
7
2
x
Sum of digits
7
9
9
4
7
6
9
7
7
2
=67
T++he check digit (x) is obtained by computing the sum of digits then computing 9 times that value modulo 10(in equation form, (67*9 mod 10)). In algorithm form:
Compute the sum of the digits (67).
Multiply by 9(603).
The last digit, 3, is the check digit. 79927398713From the rightmost digit, which is the check digit, moving left, double the value of every second digit; if the product of this doubling operation is greater than 9
(e.g.,7**2=14), then sum the digits of the products (e.g.,10:1+0=1,14:1+4=5).
Take the sum of all the digits. If the total modulo 10 is equal to 0(if the total ends in zero) then the number is valid according to the Luhn formula; else it is
not valid.
Assume an example of an account number "7992739871" that will have a check digit added, making it of the form 7992739871x:
Account number
Double every other
Sum of digits
The check digit (x) is obtained by computing the sum of digits then computing 9 times that value modulo 10(in equation form, (67**9mod10). In algorithm
form:
Compute the sum of the digits (67).
Multiply by 9(603).
The last digit, 3, is the check digit. 79927398713
C++
 CCreate the parity bits using the Luhn Algorithm to pre-check the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!