Question: Lab Exercise - 2-D Arrays in C++ In this lab exercise, you are required to write a C++ program to add two 45 matrices and

Lab Exercise - 2-D Arrays in C++ In this lab exercise, you are required to write a C++ program to add two 45 matrices and then output the results to the screen. Prompt the user to enter the name of two files with matrices Compute the sum of the two matrices and output the results . A sample run is as follows: Please enter the name of the file containing data for Array 1: input1.txt Please enter the name of the file containing data for Array 2: input2.txt The sum is: 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9 . Further requirements: o Create three functions: + readArray with void return and one 2D array argument and one string argument printArray with void return and one 2D array argument sumArray with void return and three 2D array arguments o Separate your code into three files as described in the lab: main.cpp my Function.cpp my Function.h . Remember, you will have to break the compiling into three steps now: a. g++ - main.cpp b.g++ - myFunction.cpp c.g++ main.o myFunction.o -o main The two input files are available by clicking: input1.txt and input2.txt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
