Do in c++. Attach an output of your program. Please write a program…
Question Answered step-by-step Do in c++. Attach an output of your program. Please write a program… Do in c++. Attach an output of your program. Please write a program that templates the class Matrix. The Matrix class should have the following data and member functions:M rows & N columnsPointer to array of pointers that stores each row on the heap via one of the pointers in the array of pointersDefault constructorParametrized constructor that sets the values of M and N and inits all elements to ValueDestructorCopy constructorgetRowSize() & getColSize()Overloaded assignment operator=( )If the row/col of the target matrix is not equal to row/col of destination matrix, print failure message and exit functionOverloaded operator+() that allows two congruent matrices to be added (add the destination elements to the corresponding. target elements producing a resultant matrix of size (M,N)friend overloaded function operator<<( ) that prints out matrix in elegant formatAfter creating a working class for int, template your function.Instantiate the case of a char matrix for the following cases: Matrix A(M=8, N=8, Value='A') and Matrix B(M==8, N=8, Value = 'B')Increment each element pf Matrix A and Matrix B by i*Row#, where i is the row numberAdd matrix A+B and assign it to matrix R(M=8, N=8, Value=' ')Output Matrix A, B and R Computer Science Engineering & Technology C++ Programming CSC 212 Share QuestionEmailCopy link Comments (0)


