Question: (In Visual C++) You will be writing a program that does addition on two matrices. It will load the matrices in from files, then do


(In Visual C++)
You will be writing a program that does addition on two matrices. It will load the matrices in from files, then do the addition, then output them to a file Matrix addition is performed by adding each element from two matrices together and forming a matrix from it. For example, if you have the following matrices: 2 To add them together, you take each of the same positions from both matrices then add themm together and build a new one Of the tl and5 1+5 2+6 3+7 4 + 8 6 8 10 12 You can use any number of elements in the matrices as long as they are both the same size. (For example, you can add a 3x4 with a 3x4, but you can't add a 3x6 matrix and a 3x8 matrix. By using two-dimensional arrays, you can represent matrices, add them together, store the results, and then using some loops you can put it back into a file For the purpose of this assignment, matrices will never be larger than 20x20, so in your code you should create your matrices of this size, then just keep track of how much space they are taking up. Numbers will also be integers from 0 to 100 Directions 1. Open Visual Studio 2012. 2. 3. 4. Create a new project and name it Lab3. Open up Blackboard Download the Lab3Array.cpp file, along with input.txt. Save them to your project folder (usually under My Documents, then under Visual Studio 2010, Projects, Lab3Array, then Lab3Array) 5. In Visual Studio, click on Project, Add Existing Item, and Lab3Array.cpp should be there. Add it to your project. Edit the comments at the top of the file with your name and the date. 6. 7. Start implementing the missing parts. File Structure The input files will start with two integers, the width and height of both matrices. After that the numbers of the first matrix are listed, then the second. The numbers will be sorted by row then column (with the examples above it will be "1 2 3 4"). The file may have more than one set of matrices to it, which you can loop through to do the addition on all of it. The output file, output.txt, should also have the answer listed the same way (width, height, then the numbers)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
