subject

There are two text files, whose names are given by two String variables, file1 and file2. These text files may NOT have the same number of lines. Write a sequence of statements that creates a new file whose name consists concatenating the names of the two text files (with a "-" in the middle) and whose contents of merging the lines of the two files. Thus, in the new file, the first line is the first line from the first file, the second line is the first line from the second file. The third line in the new file is the second line in the first file and the fourth line is the second line from the second file, and so on. If, as is likely, one file runs out first stop writing to new file and create another new file called "leftovers". Copy the remaining lines that have not been written out that into "leftovers". When finished, make sure that the data written to the new files have been flushed from their buffers and that any system resources used during the course of running your code have been released.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:30
Avariable definition defines the name of a variable that will be used in a program, as well as
Answers: 3
question
Computers and Technology, 23.06.2019 00:30
Which of the following would you find on a network
Answers: 3
question
Computers and Technology, 23.06.2019 10:30
Would a ps4 wired controller work on an xbox one
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Anetwork security application that prevents access between a private and trusted network and other untrusted networks
Answers: 1
You know the right answer?
There are two text files, whose names are given by two String variables, file1 and file2. These text...
Questions
question
History, 24.06.2021 06:40
question
English, 24.06.2021 06:50
question
Law, 24.06.2021 06:50
question
Mathematics, 24.06.2021 06:50
question
Mathematics, 24.06.2021 06:50
Questions on the website: 13722362