Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that opens two text files (input1.txt and input2.txt) for input and one for output (output.txt). The program should merge the two input

Write a program that opens two text files (input1.txt and input2.txt) for input and one for output (output.txt). The program should merge the two input files in the output files. While doing the merge, it will read one line from input1.txt and one line from input2.txt and write those in the output file one after other. Then it will read the next line from input1.txt and next line from input2.txt and write them one after other in the output file. Here is an example. input1.txt: This is the first line in input1.txt. This is the second line in input1.txt. This is the third line in input1.txt. This is the fourth line in input1.txt. input2.txt: This is the first line in input2.txt. This is the second line in input2.txt. This is the third line in input2.txt. outtput.txt This is the first line in input1.txt. This is the first line in input2.txt. This is the second line in input1.txt. This is the second line in input2.txt. This is the third line in input1.txt. This is the third line in input2.txt. This is the fourth line in input1.txt. After the writing in output.txt, count the number of lines in output.txt. Also, write the number of times term input1 appears in output.txt file.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions

Question

Question What is a Roth 403 (b) plan?

Answered: 1 week ago