Question: Write a program that receives m and n as the number of rows and columns of a matrix, respectively. Then it follows by m lines

Write a program that receives m and n as the number of rows and columns of a matrix, respectively. Then it follows by m lines of input from the user, each referring to n integers in each row of the matrix. The program then continuously reads commands from user and performs different operations based on users command. Users command will be one of the following: ? T: Transpose - rows become columns (and vice versa) and prints the result matrix. ? R: RowMultiply - multiplies all values in each of the rows and prints the results in one line, separated by space. ? C: ColumnMin - finds the smallest value in each of the columns and prints the results in one line, separated by space. ? Q: Quit - stops reading commands from the user. If user enters one of the first three commands, the operation should be applied to the original matrix. The result of each operation is either printing a new matrix (if the command is T) or printing the result of calculating RowMultiply or ColumnMin in one line (if the command is R or C). Please note that each of the T, R, and C commands should be applied to the original matrix (not on the matrix that results from the most recent operation). If user selects the quit option by entering Q, it terminates the program execution. It will be a good practice if you implement R, C, and T operations using separate methods.

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!