Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the code needed in java What to use in your completed java code Get input from file. Ask user at least a single question and

the code needed in java

What to use in your completed java code

Get input from file. Ask user at least a single question and read at least one answer. Use at least a single method from Math class. Use at least one overloaded constructor. Use at least one if-else-if, while, for, and enhanced for loops. Use methods to pass and return identifiers and objects. Pass arrays to/from methods. Use at least a method to sort the array in the project. Use inheritance and polymorphism. Use exception handling. Use input validation. Pass the input and output files as commandline arguments.

Credit card numbers and the case of Mobius Duck 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.

- Implement the full Issuer IIN Range instead of the simplified list

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)

image text in transcribed

image text in transcribed

Data to Evaluate 3158539628375348

3337465828248404

3112804683572030

3112804683572033

5435528978467581

6706465468107999

6304362971054667

6706169762827894

6706169762827892

4844104341377697

4913405490886727

4844885754351829

4844885754351822

6371473570875275

6381475006869978

6389057917814806

347100734345549

347100734345543

6011162533805000

6011621663574413

6011824617460743

6011824617460745

6389057917814802

4539318768050385

36880982786892

36845793345501

36661154562232

36661154562234

5893329089846994

6761680165952016

6763100400984029

6763100400984022

5127043299122389

5330838017737340

5429168755154025

5429168755154023

375354034606481

379570632133224

4485521241443135

4532916206508075

4532916206508076

5590976687287124

5540641137519895

5540641137519892

30522070708059

30066552673241

30365487186802

30365487186801

image text in transcribed

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) Luhn Example: Steps Total Original Number Drop the last digit Reverse the digits: Multiple odd digits by 2 Add digits from line above Add all numbers Mod 10 4 5 5 6 7 3 7 5 8 6 8 9 9 8 5 5 4 5 5 67 3 7 5 8 68 9 9 8 5 5 8 9 98 68 5737 6 554 10 8 18 9 16 616 514 3 14 6 10 58 1 1 8 9 97 67 55 3 5 61 58 8 9976 7 5 5 3 5 6 1 5 8 85 (85 +X) modulo 10-0, thus X-5 (last digit of card) 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) Luhn Example: Steps Total Original Number Drop the last digit Reverse the digits: Multiple odd digits by 2 Add digits from line above Add all numbers Mod 10 4 5 5 6 7 3 7 5 8 6 8 9 9 8 5 5 4 5 5 67 3 7 5 8 68 9 9 8 5 5 8 9 98 68 5737 6 554 10 8 18 9 16 616 514 3 14 6 10 58 1 1 8 9 97 67 55 3 5 61 58 8 9976 7 5 5 3 5 6 1 5 8 85 (85 +X) modulo 10-0, thus X-5 (last digit of card)

Step by Step Solution

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions