C++
Write a program with the following elements:
in main()
-opens the 2 files provided for input (Lab_HW9_2Merge1.txt and Lab_HW9_2Merge2.txt)
-calls a global function to determine how many lines are in each file
-creates 2 arrays of the proper size
-calls a global function to read the file and populate the array (call this function twice, once for each file/array)
-calls a global function to write out the 'merged' results of the 2 arrays
*if there are multiple entries for a person, these should be merged and should appear as a single entry in the resulting file
*resulting file should be named 'merged_output.txt'
program should check to see if a name is already present in one file or another. If the name is present in both files display the name once in the merged file and add the numbers.
Example:
1st File:
Carlos 7
Tina 3
2nd File:
Lena 2
Carlos 3
Merged File:
Carlos 10
Tina 3
Lena 2

![fa[i]=agel[i] //outfile<<agel[i]<<endl; for(i=0;i<f2;i++) infile2>>name2[i]; infile2>>age2[i]; for(int j=0; j<fl ; j++) { if(](http://img.homeworklib.com/questions/91bdddc0-0b9a-11ec-a693-b15f382d5bd6.png?x-oss-process=image/resize,w_560)
C++ Write a program with the following elements: in main() -opens the 2 files provided for...
write program in C language.
To get more practice working with files, you will write several functions that involve operations on files. In particular, implement the following functions 1. Write a function that, given a file path/name as a string opens the file and returns its entire contents as a single string. Any endline characters should be preserved char *getFileContents (const char filePath); 2. Write a function that, given a file path/name as a string opens the file and returns...
C++.Write a program that opens two text files and reads their contents into two separate queues. The program should then determine whether the files are identical by comparing the characters in the queues. When two nonidentical characters are encountered, the program should display a message indicating that the files are not the same. If both queues contain the same set of characters, a message should be displayed indicating that the files are identical. Sample Run Suppose we have two files...
C++: Make sure to identify codes with comments and no other programming other than C++ (please make it simple as possible) DON'T COPY CODES FROM OTHER ANSWERS Create a program that: - in main - opens the file provided for input - calls a function to determine how many lines are in the file - creates an array of the proper size - calls a function to read the file and populate the array ...
Kindly solve this using C PROGRAMMING ONLY.
4. Write a program marks.c which consists of a main function and three other functions called. readmarks , changemarks (, and writemarks() The program begins by calling the function readmarks () to read the input file marksin. txt which consists of a series of lines containing a student ID number (an integer) and a numeric mark (a float). Once the ID numbers and marks have been read into arrays (by readmarks () the...
JAVA Write a program that prompts the user to enter a file name, then opens the file in text mode and reads it. The input files are assumed to be in CSV format. The input files contain a list of integers on each line separated by commas. The program should read each line, sort the numbers and print the comma separated list of integers on the console. Each sorted list of integers from the same line should be printed together...
Language: c++ Write a program that opens a file to read 20 floating point numbers and store the information in a 4 x 5 array. The program should do the following: a. Compute the average of each set of 5 values b. Determine the largest value of the 20 values c. Report the results; print the original matrix and average of each row, and the largest of the values in this function. d. At the end of the program prompt...
Description: Merge two or more text files provided by the user into a new text file where the names of the text files to join and the output text file are provided to the program using command line arguments. Purpose: This application provides experience working with command line arguments, writing files to disk, reading files from disk, working with exceptions, and writing programs in C#/.NET. Requirements: Project Name: DocumentMerger2 Target Platform: Console Programming Language: C# In a previous challenge, Document...
Write a C program as follows:
Single source code file
Calls a function with an arbitrary name (i.e. you name it) that
accepts two arrays of the same size
The function should add each element in the arrays together and
place the values in a third array
Each array element, each array address, and the sum are printed
to the screen in tabulated format with headersI also would like to request
that LOTS of comments be included, as I need...
Write a complete JAVA program to do the following program.
The main program calls a method to read in (from an input file) a set of people's three-digit ID numbers and their donations to a charity (hint: use parallel arrays)Then the main program calls a method to sort the ID numbers into numerical order, being sure to carry along the corresponding donations. The main program then calls a method to print the sorted 1ists in tabular form, giving both ID...
write a code on .C file
Problem Write a C program to implement a banking application system. The program design must use a main and the below functions only. The program should use the below three text files that contain a set of lines. Sample data of these files are provided with the assessment. Note that you cannot use the library string.h to manipulate string variables. For the file operations and manipulations, you can use only the following functions: fopen(),...