Design a to perform various matrix operations class a


Design a to perform various matrix operations. class A matrix is a set of numbers arranged in rows and columns. Therefore, every element of a matrix has a row position and a column position. If A is a matrix of five rows and six columns, we say that the matrix A is of the size 5x6 and sometimes denote it as A5x6. Clearly, a convenient place to store a matrix is in a two-dimensional array.

Two matrices can be added and subtracted if they have the same size. Suppose A = [aij] and B = [bij] are two matrices of the size m x n, in which aij denotes the element of A in theith row and the jth column, and so on. The sum, difference, increment and decrement are given by:

A + B = [aij + bij]

A - B = [aij - bij]

A++ or ++A= [aij+1]

· Design and implement a class matrixType that can store a matrix of any size.

· Overload the operators +, - and ++ to perform the addition, subtraction and increment operations, resp..

· Overload the operator >> to take input in to a matrix from the user. First ask for the values of first row, then the values of the second row and so on.

· Overload the operator << to output a Matrix in the proper format i.e. each row on a new line and each value separated by whitespace. Also, write a test program to test various operations on the matrices.

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Design a to perform various matrix operations class a
Reference No:- TGS0661378

Expected delivery within 24 Hours