Question: Write a program that reads a matrix from the keyboard and displays the summations of all its rows on the screen. The size of matrix

 Write a program that reads a matrix from the keyboard and

Write a program that reads a matrix from the keyboard and displays the summations of all its rows on the screen. The size of matrix (i.e. the number of rows and columns) as well as its elements are read from the keyboard. A sample execution of this program is illustrated below: Enter the number of rows of the matrix: 3 Enter the number of columns of the matrix: 4 Enter the element at row 1 and column 1: 1 Enter the element at row 1 and column 2: 2 Enter the element at row 1 and column 3: 3 Enter the element at row 1 and column 4: 4 Enter the element at row 2 and column 1: 5 Enter the element at row 2 and column 2: 6 Enter the element at row 2 and column 3: 7 Enter the element at row 2 and column 4: 8 Enter the element at row 3 and column 1: 9 Enter the element at row 3 and column 2: 10 Enter the element at row 3 and column 3t 11 Enter the element at row 3 and column 4: 12 The sum of elements in the row 0 ist The sum of elements in the row 0 is: 10 The sum of elements in the row 1 1s: The sum of elements in the row 1 is: 26 the aun of elements in the row 2 i31 The sum of elements in the row 2 s: 42 Hint Use a list of lists to store your matrix. Your list could have as many elements as the number of the matrix rows that each element includes as many numbers as the size of the matrix column. For example, the list [[1, 2,3, 4]. [5, 6, 7,8], [9, 10, 11, 12]] can represents the following matrix: 9 10 11 12

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!