Respuesta :
The program is an illustration of file manipulation
What is file manipulation?
File manipulation involves reading from a file, appending content to a file and writing out from a file
The main program?
The program written in Java, where comments are used to explain each action is as follows:
//This creates an object of file 1
File file1 = new File(file1);
//This creates an object of file 2
File file2 = new File(file2);
//This reads the content of file 1
Scanner input1 = new Scanner(file1);
//This reads the content of file 2
Scanner input2 = new Scanner(file2);
//This gets the name of the new file
String sFile3 = file1 + "-" + file2;
//This creates an object of file 3
File file3 = new File(sFile3);
//This creates an object of the output file
PrintWriter printOut = new PrintWriter(file3);
//The following loop is repeated until the end of file 1
while(input1.hasNextLine()){
//These print each line of files 1 and 2 to file 3
printOut.println(input1.nextLine());
printOut.println(input2.nextLine());
}
//This closes file 1
printOut.close();
//This closes file 2
printOut.close();
Read more about file manipulation at:
https://brainly.com/question/16397886