Two Text Files Whose Names Given Two String Variables File1 File2 Text Files Number Lines Q13059175

There are two text files, whose names are given by two Stringvariables , file1 and file2. These text files have the same numberof lines. Write a sequence of statements that creates a new filewhose name consists concatenating the names of the two text files(with a “-” in the middle) and whose contents of merging the linesof the two files. Thus, in the new file, the first line is thefirst line from the first file, the second line is the first linefrom the second file. The third line in the new file is the secondline in the first file and the fourth line is the second line fromthe second file, and so on. When finished, make sure that the datawritten to the new file has been flushed from its buffer and thatany system resources used during the course of running your codehave been released.(Do not concern yourself with any possibleexceptions here– assume they are handled elsewhere.)

“We Offer Paper Writing Services on all Disciplines, Make an Order Now and we will be Glad to Help”

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.