Write a program which checks each credit card number in the


You need help writing this program in JAVA, this is an introductory java course, so if possible, keep it as basic/simple as possible while still following the instructions. The output should look like the sample execution at the end of the problem.

You have been hired by a credit card company to test their software which generates credit card numbers for new members.

The software produces a text file with a bunch of generated credit card numbers. Your task is to write a program which checks each credit card number in the file and determines whether or not the card number is valid.

Credit card numbers follow a certain pattern. The number must have between 13 and 16 digits. The number must start with:

4 for Visa Cards

5 for Master Cards

34 or 37 for American Express cards

6 for Discover Card cards

An algorithm exists to determine whether or not a card number is valid. The algorithm is as follows: (for this example we will use the card number 4388576018402626)

1. Double every second digit from right to left. If doubling of a digit results in a two-digit number, add up the two digits to get a single-digit number.
    4388576018402626
    2 * 2 = 4
    2 * 2 = 4
    4 * 2 = 8
    1 * 2 = 2
    6 * 2 = 12 (1 + 2 = 3)
    5 * 2 = 10 (1 + 0 = 1)
    8 * 2 = 16 (1 + 6 = 7)
    4 * 2 = 8

2. Now add all single-digit numbers from Step 1.
    4 + 4 + 8 + 2 + 3 + 1 + 7 + 8 = 37

3. Add all digits in the odd places from right to left in the card number.
    4388576018402626
    6 + 6 + 0 + 8 + 0 + 7 + 8 + 3 = 38

4. Sum the results from Step 2 and Step 3.
    37 + 38 = 75

5. If the result from Step 4 is divisible by 10, the card number is valid; otherwise, it is invalid.
    (75 % 10 == 0) //this is false so the card is not valid.

Write a program that uses JFileChooser to allow the user to select the input file of credit card numbers. Process the file by determining which card numbers are valid and which are invalid. Display the results in an output file NOT the console. Your results should have the following format: the card number, company name (if the company can be identified), and whether or not the card was valid or invalid. The following are examples of what your .txt might look like.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a program which checks each credit card number in the
Reference No:- TGS02874542

Expected delivery within 24 Hours