Question: Please update my code: (Write a Test Driver) This is an ADT Matrix program in c++, which allows the user to create a matrix of

Please update my code: (Write a Test Driver)

This is an ADT Matrix program in c++, which allows the user to create a matrix of any size and store it into a slot. Then the user can take the matrices in these stored slots to perform addition, subtraction, or multiplication then store the matrix in another slot.

In the run sample below: I created 2 matrices in slot 0 and 1 with the size of 3x3. and performed the 3 options of addition, subtraction, and multiplication. Everything is working, but I need to update my program with the choice 4 in the main menu (Print Matrix).

Please help me create a Testing Driver in Choice 4 (Print Matrix) of the main menu.

So, you should run the program normally like how I did in the sample run below. However, number 4(Print Maxtrix) in the main menu should be performed last in this program before the program quit. It should be an option that prints all input/output or any invalid entry from a user previously to the .txt file. This (Print Matrix) option should also be used as a test driver which to prove user matrices calculate is correct.

// Here is the code

#include #include using namespace std;

const int MAX_ROWS = 10; const int MAX_COLS = 10;

class MatrixType { public: MatrixType(); void MakeEmpty(); void SetSize(int rowsSize, 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(ostream& outfile); bool AddSubCompatible(MatrixType otherOperand); bool MultCompatible(MatrixType otherOperand); private: int values[MAX_ROWS][MAX_COLS]; int numRows; int numCols; }; MatrixType::MatrixType() { numRows = numCols = 0; } void MatrixType::MakeEmpty() { for(int i = 0; i = 1 && c >= 1) { numRows = r; numCols = c; } else cout = 0 && c = 0) values[r][c] = item; else cout

void new_matrix(int i, MatrixType * matrices, bool * add) { int r, c, temp; cout > r >> c; if(r > 0 && r 0 && c > temp; matrices[i].StoreItem(temp, j, k); } } matrices[i].Print(cout); } else cout = 0 && i > v; if(v > i; if(v > 0 && v > j >> k; if( i == j || j == k || i == k) { cout

// here is the sample run

Please update my code: (Write a Test Driver) This is an ADTMatrix program in c++, which allows the user to create a matrixof any size and store it into a slot. Then the usercan take the matrices in these stored slots to perform addition, subtraction,

Choice and Parameters New Matrix Usage:

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!