Question
Can anyone help me with this assignment? Problem 1: Design, implement and test the Matrix class. The elements of Matrix should be of the integer
Can anyone help me with this assignment?
Problem 1: Design, implement and test the Matrix class. The elements of Matrix should be of the integer type. Your Matrix class should contain at least the following features, namely:
A default constructor that sets the matrix elements to zero.
A copy constructor
A destructor
The get and set functions
Overloaded functions for as many relevant C++ built-in operators as you can (the number of overloaded operators will be one of the factors to be used in determining your grade in this mini-project). This should include the overloading of operators such as matrix negation - (a unary operator that multiplies each element of a matrix with -1), matrix pre-increment ++, matrix pre-decrement --, matrix assignment =, matrix addition + (adds two matrices to generate a sum matrix, matrix subtraction -, matrix multiplication * (vector multiplication), matrix +=, matrix equality = = and matrix inequality !=
Overload the operator( ) to perform the double scripting operations. For example, in a 3-by-5 Matrix called A, the programmer could write A (1, 3) to access the element at row 1 and column 3. There should be two versions of operator ( ), one that returns int & and one that returns const int &.
Overload the insertion << operator (to output the entire Matrix in a row-major format) and the extraction >> (to input an entire matrix in a row-major format).
Make sure that the implemented operators should be able to cascade
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started