Question: share code screen shot thanks QUESTION 2 (MATRIX MANIPULATION) A matrix is an array of numbers of size m by n (ie, mxn). When we

share code screen shot thanks
share code screen shot thanks QUESTION 2 (MATRIX MANIPULATION) A matrix is
an array of numbers of size m by n (ie, mxn). When

QUESTION 2 (MATRIX MANIPULATION) A matrix is an array of numbers of size m by n (ie, mxn). When we multiply 2 matrices, we multiply the matching numbers, then sum them up. Multiplying a matrix of size mxn with another matrix of size nxq will result in a matrix of size m xq. An example is shown in Figure 1: (3-60-6 pa +40 pb + ad ra + serb + sd ta + utbud Matrix 3 x 2 Matrix 2 x 2 Matrix 3 x 2 Figure 1: Multiplication of Matrix 3 x 2 and 2 x 2 Write a C++ program that multiplies 2 matrices and return the sum of the transposed matrix. Your program shall include the following: a) Define two 2 dimensional arrays, M and that each represents a matrix of size 3 x 2 and a matrix of size 2 x 2. Request the user to enter the values for the 2 arrays using advanced pointer notations (refer to your slides for the list of array pointer notations). b) Create a function named multMatrix( that passes as arguments, the values of array M and N. multiplies them and store the results in a new matrix MN. Use pointer notations to multiply your arrays. Display your multiplied arrays. c) Create a function named calcTotal that passes as argument, the values of array MN, sum up all its elements and return the total value from the function. Use advanced pointer notations to perform your summation. Display your result in main(). The basic program and function stubs are given below as a guideline. #include using namespace std; //declare rows and columns sizes //declare all empty arrays here as global void multMatrix(); // complete your prototype int calcTotal(://complete your prototype int main() 1/get user input for array values using nested loop //call multMatrix(): pass arrays to multiply //call caleTotal )pass multiplied array //display result of calcTotal void multMatrix)//pass 2 arrays 1/create if-elte condition in nested loop to determine index position //multiply arrays //display array int calcTotal //pass multiplied array 1/more codes here return sum; Sample Output : Ented values for array M! Enter values for array N: 2 Matrix Mx N is : 33 -14 24 The sum of elements in MN is : --! 97 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!