Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that merges the numbers in two files and writes all the numbers into a third file. Each input file contains a list
Write a program that merges the numbers in two files and writes all the numbers into a third file. Each input file contains a list of numbers of type int in sorted order from the smallest to the largest. After the program is run, the output file will contain all the numbers in the two input files in one longer list in sorted order from smallest to largest. Your program should define a function that is called with the two input file streams and the output file stream as three arguments. Sample output (bolded text denote input from user) Filenames are restricted to 12 characters Enter the first of two input file names HW10F1.txt Now a second input file name HW10F2.txt Enter the output file name. WARNING: ANY EXISTING FILE WITH THIS NAME WILL BE ERASED. output.txt END OF PROGRAM Contents of file HW 10F1.bxt are: 357 10 Contents of file HW10F2.txt are: 1 2 4 68 Contents of merged file, output.txt are: 1 2 3 4 5 67 8 10
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started