Starting from:

$30

COMP2710-Project 3 Solved

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.  

 

You must provide the following user interface. The user input is depicted as Bold, but you do not need to display user input in bold. Please replace “Li” with your name. Your program loads two input files and merges the numbers in the two files.

 

*** Welcome to Li's sorting program *** Enter the first input file name: input1.txt The list of 6 numbers in file input1.txt is:

4

13

14

17

23

89

 

Enter the second input file name: input2.txt The list of 5 numbers in file input2.txt is:

3

7

9

14

15

 


The sorted list of 11 numbers is: 3 4 7 9 13 14 14 15 17 23 89

Enter the output file name: output.txt 

*** Please check the new file - output.txt *** *** Goodbye. ***
 

Your program must follow the above user interface.  

Design Issues: 

Please do NOT intend to implement this project using a single main() function.

You need at least three functions to implement this project. The suggested functions are:

1.  array_size <- readfile(inputArray[], instream) 

2.  outputArray_size <- sort(inputArray1[], inputArray1_size, inputArray2[], inputArray2_size, outputArray[]) 

3.  void <- writefile(outputArray[], outputArray_size) 

 

Integration Testing: 

Integration testing (a.k.a., Integration and Testing) is the phase in software testing in which individual software modules are combined and tested as a group. You may use the attached two input files to test the correctness of your program as an entire system

More products