Question: Part A [40] Many mathematical problems require the addition, subtraction, and multiplication of two matrices. Write an ADT Matrix. You may use the following class

 Part A [40] Many mathematical problems require the addition, subtraction, and
multiplication of two matrices. Write an ADT Matrix. You may use the

Part A [40] 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 rowsSize, int colSize); void Storeltem(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_ROWSI[MAX COLS]: int numRows; int numCols; Before you start looking at how to implement this class, you must determine 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. Write a menu driven testing program to test your MatrixType Menu Driven Testing Interface: The menu should contain the following options GetNewMatrix Subtract second from first,leaving the result in the third MultiplyMatrices Print the matrix one row per line on DataOutPartA.txt Quit Processing Notes matrix> is a number between 0 and 9. This value is used as an index into an array of MatrixType. The main function must include a Switch statement where the case expression is a user-defined enumeration type. This means that the command is recognized and its enumeration equivalent is sent back to be used in the case statement. The driver must ensure the preconditions of the member functions of MatrixType. Throw an exception if an error occurs and continue processing

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!