Question: Create a MergeFiles application that merges the integers ordered from low to high in two text data files into a third text data file, maintaining

Create a MergeFiles application that merges the integers ordered from low to high in two text data files into a third text data file, maintaining the order from low to high (no post merge sorts!). For example, the two files of integers could contain:

File 1: 12 23 34 45 56 67 69 123 133

File 2: 4 5 10 20 35 44 100 130 150 160 180

The application should not use an array or ArrayList to temporarily store the numbers, but should merge the two files taking one element at a time from each. After MergeFiles runs for this example, the third file should contain:

4 5 10 12 20 23 34 35 44 45 56 67 69 100 123 130 133 150 160 180

Create the two input files using a text editor with the numbers of your choice. Be sure to employ proper exception handling for the file I/O. Use at least one try-catch statement that properly handles exceptions.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!