Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You are to write a program that will deal with matrices. In particular you shoul

ID: 3620555 • Letter: Y

Question

You are to write a program that will deal with matrices. In particular you should write a function that will prompt the user for a filename, open the file, and read in the matrix into an array. You should write another function that can be used to display the array on the screen.
You should assume the matrix is stored in the file as discussed above.
You should write a third function that will print the transpose of the matrix that is passed to the function.
So we expect to see three functions in your program that are named as follows:
ReadMatrix(float matrix[][25], int& numrows, int& numcols);
PrintMatrix(float matrix[][25], int numrows, int numcols);
PrintMatrixTranspose(float matrix[][25], int numrows, int numcols);

Explanation / Answer

//Header file section #include "stdafx.h" #include #include #include using namespace std; //function prototypes void ReadMatrix(float [][25], int *, int *); void PrintMatrix(float [][25], int, int); void PrintMatrixTranspose(float [][25], int, int); void main() { float matrix[25][25]; int numrows, numcols; ReadMatrix(matrix, &numrows, &numcols); PrintMatrix(matrix, numrows, numcols); PrintMatrixTranspose(matrix, numrows, numcols); //pause system for a while system("pause"); }//end main void ReadMatrix(float matrix[][25], int *numrows, int *numcols) { fstream nameFile; string filename; cout matrix[i][j]; } void PrintMatrix(float matrix[][25], int numrows, int numcols) { for ( int i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote