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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:20, gingerham1
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
image
Computers and Technology, 23.06.2019 00:30, lm18618
Which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 2
image
Computers and Technology, 23.06.2019 05:00, mariahchaparro08
Which best explains why a digital leader would join a society specializing in technology
Answers: 1
image
Computers and Technology, 23.06.2019 08:00, Buddy01
Match the items with their respective descriptions.
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 in other subjects:

Konu
Mathematics, 12.02.2020 05:18
Konu
Mathematics, 12.02.2020 05:18
Konu
Mathematics, 12.02.2020 05:18