Question: Help! Needs to be in c++ Skills Required Create Arrays, and Vectors, iterate over them. Datatypes, assignment, etc. Basic git commands Create Functions, Include Headers
Skills Required Create Arrays, and Vectors, iterate over them. Datatypes, assignment, etc. Basic git commands Create Functions, Include Headers and other files, Loops (while, for), Conditional (if, switch), This assignment will have you use a 2-dimensional array or a 2-dimensional vector of integers to create a matrix and do matrix addition and matrix multiplication. Since you can't resize a 2-dimensional array you can create a 20x20 integer array, only using the columns and rows for the sizes the user creates The program will ask the user for the size of the first matrix; rows and columns, and then the values for the cells in the matrix. It willthen do the same for the second matrix, then if possible, add the matrices together. (The # of rows and columns have to be equal) If time allows do matrix multiplication on the matrices if they can be multiplied together. Rules for that given below. The choice of 2-dimensional array or vector is up to you, they both have advantages and drawbacks. suggest you choose one make sure you can populate it with data and output before getting into the details of the project. Below are 2 examples of creating a matrix. // Creating a matrix with 2-dimensional array. and set row e column 2 to 5 int matrix1[20][28]; matrixi[][2 5; vectorevectoreint)> matrixi; matrixl.resize(7); 11 Set the number of rows to 7 matrixi.at (e).resize(6); I/ Set the number of coluns in row e to be 6 matrixi.at(e).at(2)- 5 1. Follow the link that was given on Canvas for this Assignment to create your repository 2. Set up Visual Studio as instructed from assignment page. a. Ask the user for the number of rows in the 1" matrix, and then the number of columns for it. Let them enter all the values for the matrix, then display it back to them. b. Do the same for matrix 2 c. If the matrix can be added, then add the 2 matrices together and output the results i. To be able to add 2 matrices they must be the same size a1,0 a1,1 a1,2 a+b 8 10 12 10 11 12 14 16 18 2 31I7 89 d If the matrix can be multiplied then multiply them together and output the results. matrices, a and b, can be multiplied together if the number of columns in matrix a is equal to the number of rows in b. The resulting matrix size will be the number of rows in matrix a, and the number of columns of matrix b. 2 i. A value at a particular row column Elo arow bicot n is the number of columns in matrix a (which is also the number of rows in matrix b). nter the number of columes in this satrix ease ester the values in this sstrix, you cen enter each rou at once, each cell or all of thee separated by spaces 23456 ou entered the grid gl as nter the nuber of rous in this matrix 3 ter the muner of colums in this wtri lease enter the values in this atrix, you can enter each row et once, each cell or all of thee separated by ses 23456 ou entered the grid a ennot edd 2 grlds of this size toether, the of ros and celumns In g2 is ress Q to owit, any other key to do another erld ress Q to quit, any other kry to do another grid nter the uaber of ros in this matris ter the aber of celumms in this eatria2 Inase enter the values ie this matris, you a enter each row at ance, each cell or all of thee srparated by spaces entered the grid gt as eter the maber of columns in this natris 2 enstered the rid Page 2 3+ ea si 6:45 P do 2/19/201 ^
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
