Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA HW (NO ARRAYS) SAMPLE OUTPUT FILE You have been hired by a crEdil card CDrnFlarly la test thrir sonwall which general es credit card
JAVA HW (NO ARRAYS)
SAMPLE OUTPUT FILE
You have been hired by a crEdil card CDrnFlarly la test thrir sonwall which general es credit card numbers rar new rnembers ThH sortware productes a lext filHe vilh a bunch ofgen raledCIKiil card nurnberrs Your task is to write prograrn which chtecks each Dreil card number in the file and determi es whether or not the ca d number is vaid Credit cari numbers follow a certain pattem. The number must have between 13 and 16 digits. The number must start with: 4 or Visa Cards 34 or 3 for Amer Ican Exp 6 tor Discover Card cards An algorithm exists to detemine whether or not a card number is valid. The algorithm is as folovs: (for this example we wil use the card number 4388576018402626) 1. Double every second cigt trom right to lett lt doublng of a digt results n a two cigt number, add up the two digts to get a sngle digt number 43885760 2 2-4 4 2 6.2 12 (1 2 5 2 10 0- 1 8' 2 16 (1 6-7 4 2 2. Now add all ngle digit numbers trom Step 1. 4 4 8 2 3 37 3. Add all digits in the odd placcs from right to loft in thc card numbor. 1388576018102626 6 6 0 8 0 7 8 3 38 4. Sum tho rcsults from Step 2 and Stcp 3. 37 t 38 75 the result from Step 4 s ble by 10, the card number is valid otherwis is invalid 75 10 his is falso 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 fie by detemining 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 he company can be identified), and whether or not the ca was valid or invalid he following are examples of what your -txt might look like. To get credit for this assignment, you MUST make creative use of your own methods. Your program should be intuitively divided into an appropriate number of methods for this type of project. This program must strictly follow the ONE TASK PER METHOD ruleStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started