Computers and Technology

The following checksum formula is widely used by banks and credit card companies to validate legal account numbers: d0 + f(d1) + d2 + f(d3) + d4 + f(d5) + . . . = 0 (mod 10) The di are the decimal digits of the account number and f(d) is the sum of the decimal digits of 2d (for example, f(7) = 5 because 2 x 7 = 14, and 1 + 4 = 5). For example, 17327 is valid because 1 + 5 + 3 + 4 + 7 = 20, which is a multiple of 10. Implement the function f and write a program to take a 10-digit integer as a command line argument and print a valid 11-digit number with the given integer as its first 10 digits and the checksum as the last digit. Check that when applying the formula to the 11-digit number, the result after mod 10 is 0.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:30, lilpeepxliltracy
This technology is used to produce high-quality documents that look good on the computer screen and in print.
Answers: 1
image
Computers and Technology, 23.06.2019 07:30, barkonatree
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, gabby640
Name the range function that would generate the following list of integers values: 0,1,2,3,4,5.
Answers: 1
image
Computers and Technology, 23.06.2019 11:00, swelch2010
Describe three characteristics of at-risk drivers. a. b. c. describe three characteristics of safe drivers. a. b. c. describe three driver errors that could cause a collision. a. b. c. how will this information affect you as a driver now and in the future? (2-3 sentences)
Answers: 2
Do you know the correct answer?
The following checksum formula is widely used by banks and credit card companies to validate legal a...

Questions in other subjects: