Question: Please update the code below: Create a text file which to transfer all selection from main(), like input, output and result to the text file

Please update the code below: Create a text file which to transfer all selection from main(), like input, output and result to the text file after run and end the program.

#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 a sample run of the program:

Please update the code below: Create a text file which to transfer

O X C:\Users\Erickson\Documents\Visual Studio 2015\Projects\MatrixTy... - Choice and parameters: O New Matrix Usage: 0 1 Add Matrices Usage: 1 2 Subtract Matrices Usage: 2 3 Multiply Matrices Usage: 3 4. Print Matrices Usage: 4 5 Quit Usage: 5 matris material Enter Choice and Parameters: 0 0 Creating new matrix in slot 0. Enter row and column size: 3 3 Row 0: 1 2 3 Row 1: 4 5 6 Row 2: 7 8 9 [ 1 2 3 ] | 4 5 6 1 [ 7 8 9 ] Choice and parameters: O New Matrix Usage: 0 1 Add Matrices Usage: 1 2 Subtract Matrices Usage: 2 3. Multiply Matrices Usage: 3 4 Print Matrices Usage: 4 5 Quit Usage: 5 Enter Choice and Parameters: . O X C:\Users\Erickson\Documents\Visual Studio 2015\Projects\MatrixTy... - Choice and parameters: O New Matrix Usage: 0 1 Add Matrices Usage: 1 2 Subtract Matrices Usage: 2 3 Multiply Matrices Usage: 3 4. Print Matrices Usage: 4 5 Quit Usage: 5 matris material Enter Choice and Parameters: 0 0 Creating new matrix in slot 0. Enter row and column size: 3 3 Row 0: 1 2 3 Row 1: 4 5 6 Row 2: 7 8 9 [ 1 2 3 ] | 4 5 6 1 [ 7 8 9 ] Choice and parameters: O New Matrix Usage: 0 1 Add Matrices Usage: 1 2 Subtract Matrices Usage: 2 3. Multiply Matrices Usage: 3 4 Print Matrices Usage: 4 5 Quit Usage: 5 Enter Choice and Parameters

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!