Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

From the rightmost digit, which is the check digit, moving left,double the value of every second digit; if the product of thisdoubling operation is greater

From the rightmost digit, which is the check digit, moving left,double the value of every second digit; if the product of thisdoubling operation is greater than 9 (e.g., 7 * 2 = 14), then sumthe 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 totalends in zero) then the number is valid according to the Luhnformula; else it is not valid.

Assume an example of an account number "7992739871" that willhave a check digit added, making it of the form 7992739871x:

Account number7992739871x
Double every other718947691672x
Sum of digits7994769772=67

The check digit (x) is obtained by computing the sum of digitsthen 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.

Credit Card error detection check -> Luhn Algorithm, (http://www.freeformatter.com/credit-card-number-generator-validator.html#cardFormats)

Step by Step Solution

3.41 Rating (148 Votes )

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java Concepts Late Objects

Authors: Cay S. Horstmann

3rd Edition

1119186714, 978-1119186717

More Books

Students also viewed these Programming questions