Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CODE in C++ PLEASE code the program in more basic C++ Write a program that merges the numbers in two files and writes all the

CODE in C++ PLEASE code the program in more basic C++

Write a program that merges the numbers in two files and writes all the numbers into a third file. Your program takes input from two different files and writes its output to 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 at least one function that is called with the two input-file streams and the output-file stream as three arguments. The list of numbers are not necessary of the same length. Aske the user for each file name and test if the file exit. Show the content of all three files on a screen

Sample input file 1:

22

44

55

77

99

500

Sample input file 2:

11

55

101

Sample output file:

11

22

44

55

55

77

99

101

500

This is how the complied program should look

image text in transcribed

hi le Entering Tile names,please enter the Tile name fol lowed byextension. Enter the first of two input file names: inNamel.txt Now a second input file name i nName2.txt Enter the output file name WARNING: ANY EXISTING FILE WITH THIS NAME WILL BE ERASED outName.txt Contents of file inName1.txt are: 500 Contents of file inName2.txt are: 101 Contents of merged file, outName.txt are: 101 500 Press any key to continue

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

Step: 3

blur-text-image

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

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions