Question: Please code in C++: Assignment 1: MatrixType Many mathematical problems require the addition, subtraction, and multiplication of two matrices. Write an ADT Matrix. You may
Please code in C++:



Assignment 1: MatrixType Many mathematical problems require the addition, subtraction, and multiplication of two matrices. Write an ADT Matrix. You may use the following class definition. const int MAX_ROWS = 10; const int MAX_COLS = 10; class MatrixType public: MatrixType(); void MakeEmpty(); void SetSize (int rows Size, int colSize); void StoreItem(int item, int row, int col); void Add (MatrixType otheroperand, MatrixType & result); void Sub (MatrixType otherOperand, MatrixType & result); void Mult (MatrixType otheroperand, MatrixType& result); void Print (ofstream& outfile); bool AddSubCompatible (MatrixType otherOperand); bool MultCompatible (MatrixType otherOperand); private: int values [MAX_ROWS] [MAX_COLS]; int numRows; int numCols; ); Before you start looking at how to implement this class, you must determine and document the appropriate preconditions and postconditions for each operation. Note that the class provides the member functions to allow the client to determine if the binary matrix operations are possible. Before this class can become a permanent part of your program library, it must be thoroughly tested. Write a menu driven testing program to test your MatrixType. Menu Driven Testing Interface The menu should contain the following options. (See processing notes for definition of
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
