In this project, you are assisting an investigation. The investigator asked you to help him determine the validity of credit card numbers located in a case of Mobius Duck, case number 20150510-001.
Your task is to:
– Read the data listed below “Data to Evaluate” from a file.
– Evaluate each number to see if they are representing a possible credit card number.
– Validate each credit card number to see if they are a valid number.
– Store the valid numbers and invalid numbers in a separate array.
– Write the contents of validated credit card number array into a file called “valid_cards.txt”.
– Write the invalid credit card number array to a file called “invalid_numbers.txt”.
– Make sure to include the issuer for each group of credit card numbers identified.
– Your application should work with any number of credit card entries
How to validate Credit Card Numbers?
Most credit card number can be validated using the Luhn algorithm, which is more or a less a glorified Modulo 10 formula!
The Luhn Formula:
• Drop the last digit from the number. The last digit is what we want to check against
• Reverse the numbers
• Multiply the digits in odd positions (1, 3, 5, etc.) by 2 and subtract 9 to all any result higher than 9
• Add all the numbers together
• The check digit (the last number of the card) is the amount that you would need to add to get a multiple of 10 (Modulo 10)
This assignment has been answered 5 times in private sessions.
© 2021 Codify Tutor. All rights reserved