Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 2 Lncs 8056

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013th Edition

3642401724, 978-3642401725

More Books

Students also viewed these Databases questions