Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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++
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 0Write 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started