Question: The program must be in C++ 10 19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

The program must be in C++

The program must be in C++ 10 19 1 2 3 4

10 19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 0 0 0 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 0 0 0 0 0 4 5 6 7 8 9 10 11 12 13 14 15 16 0 0 0 0 0 0 0 5 6 7 8 9 10 11 12 13 14 15 0 0 0 0 0 0 0 0 0 6 7 8 9 10 11 12 13 14 0 0 0 0 0 0 0 0 0 0 0 7 8 9 10 11 12 13 0 0 0 0 0 0 0 0 0 0 0 0 0 8 9 10 11 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 10 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 

Write a program that 1. reads matrix.txt into a 2D array; 2. construct the transpose of the input matrix with a function named transpose; 3. stores the result in matrix transpose.txt The first row of matrix.txt contains the number of rows and columns of the matrix. Below is the content ofmatrix.txt: 10 19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 0 0 3 4 5 6 7 8 91011 12 13 14 15 16 17 e e 0 0 0 4 5 6 7 8 9 10 11 12 13 14 15 16 0 0 0 000056789101112131415 0000 0 0 0 0 0 6 7 8 9 10 11 12 13 14 0 0 0 0 0 00000078910111213000000 00000008910 11 12 0000000 0000000091011 0 0 0 0 0 0 e 0 1e 0 0 0 e0 0 0 0 0 e When the program is done, matrix_transpose.txt should be 19 10 2 2 e e e e e e e 0 3 3 3 0 e e 0 e 0 0 4 4 4 4e 0 0 0 0 5 5 5 5 5 0 e e 0 0 6 6 6 6 6 6 e e 0 0 8 8 8 8 8 8 8 8 e 0 9 9 9 9 9 9 9 9 9 0 10 10 10 10 10 10 10 10 10 18 12 12 12 12 12 12 12 12 e e 13 13 13 13 13 13 13 0 0 0 14 14 14 14 14 14 0 0 15 15 15 15 15 0 0 0 0 16 16 16 16 0 e e 0 0 18 18 000000 19 0 0 0 0 0 0 To read external file in C++, you need to include library. Below are steps in reading file: 1. Create an ifstream object: ifstream file_input("filename.txt"); 2. Retrieve input: file_input >> some_variable; 3. Close the file: file input.close(); To write a file is similar to reading file 1. Create an ofstream object: ofstream file_output ("filename.txt"); 2. Retrieve input: file_output

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!