Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Your task is to: Read the data listed below \"Data to Evaluate\" from a file ey

ID: 3704487 • Letter: Y

Question

Your task is to: Read the data listed below "Data to Evaluate" from a file ey are representing a possible credit card number - Evaluate each number to see if th - 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 Your application should work with any number of credit card entries. of credit card numbers identified. - Turn in: Source code (java) files of all classes and driver class. Completed UML for application classes. Flow chart for every method that contains beyond sequential logic flow Generated javadocs structure Input and output files - - Grading -Naming standard followed for project files-2% -input and output files-290 -Javadoc structure-5% Project compiled without error-91% Proper use of internal comments, docstrings, and tags-5% -Self documenting field, identifier, method, static, final, and class identifiers-5% Properly validated input and output files-5% Properly used arrays to store data-5% Correct output calculated by the Luhn algorithm and card number issuer identified-71% Extra Credit: Implement the full Issuer IIN Range instead of the simplified list.

Explanation / Answer

Below is the complete code:

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package cheggquestions;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.*;
/**
*
* @author Prashant Tomer
*/
public class Creditcardverification {
  
public static void main(String[] args) {
try
{
FileReader fr=new FileReader("D://Datatoevaluate.txt");
BufferedReader br=new BufferedReader(fr);
FileWriter vcard=new FileWriter("D://valid_cards.txt");
BufferedWriter bwr=new BufferedWriter(vcard);

FileWriter ivcard=new FileWriter("D://invalid_numbers.txt");
BufferedWriter ibwr=new BufferedWriter(ivcard);

String str=null;

String valid[]=null;
String invalid[]=null;
int validarr=0,invalidarr=0;
while((str=br.readLine())!=null)
{
System.out.println(str);
  
if(str.startsWith("34")| str.startsWith("37") | str.startsWith("4") | str.startsWith("51") | str.startsWith("6011"))
{
valid[validarr]=str;
validarr++;
}
else
{
invalid[invalidarr]=str;
invalidarr++;
}
}


for(String cards:valid)
{
System.out.println("here"+cards);
bwr.write(cards);
}
for(String icards:invalid)
{
ibwr.write(icards);
}
ibwr.close();
ivcard.close();
bwr.close();
vcard.close();
br.close();
fr.close();

}catch(Exception ex){}
}
  
}