Write a program in Java that will take in two files file as parameters and generate a series of files depending on how many records are in the 2nd file.
Copies of the two files are in Appendix A & Appendix B
Appendix A
File 1
SOFTPLUS
2 Sangarah Close
Labone
P.O. Box 3856
Accra North
Dear ???,
RE: Graduate Entry Placement
Thank you for applying for the position of ???? at SOFTPLUS in our ???? department. SOFTPLUS will like to invite you to attend an interview for the position. Your interview will be scheduled for ????. Please bring your CV. After your formal interview you would be required to sit a 1hr technical paper.
Please contact our Human Resources department if you have any problems or require further information.
Yours Sincerely
quojo
Appendix B
File 2
John Diamond, Oracle Dba, System Admin , May 21 2014
William Nettey, Junior Developer , IT Support , May 21 2014
Janet Owusu , Business Analyst , Credits , May 28 2014
Kofi Neequaye, Linux Administrator, , System Admin , May 21 2014
Naa-Dei Thompson, Business Analst, Risks, May 28 2014
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
//import java.io.BufferedReader;
public class file {
public static void main(String[] args) {
//File fileA =null;
// File fileB =null;
try{
String Awords = " This is the life ";
String Bwords = " The jave rock the life ";
File fileA = new File("Appx A.txt");
File fileB = new File("Appx B.txt");
if(fileA.createNewFile()& fileB.createNewFile())
System.out.println("Success!");
else
System.out.println
("Error, file already exists.");
FileWriter riteA = new FileWriter(fileA.getAbsoluteFile());
FileWriter riteB = new FileWriter(fileB.getAbsoluteFile());
BufferedWriter Arite = new BufferedWriter(riteA);
BufferedWriter Brite = new BufferedWriter(riteB);
Arite.write(Awords);
Brite.write(Bwords);
Arite.close():
Brite.close();
}
catch(IOException ioe) {
ioe.printStackTrace();
}
}
}