Question: (a) Write pseudocode for an algorithm called MatrixManip which takes as input two n x n integer arrays A and B and does the following:

(a) Write pseudocode for an algorithm called MatrixManip which takes as input two n x n

integer arrays A and B and does the following:

(i) calculatesthearrayC,thesumofthetwoarrays (ii) calculates the array D = 3C (iii)Calculates the difference between S1, the sum of the elements in the first array and

S2, the sum of the elements of the second array.

(b) Using a programming language of your choice, implement the algorithm MatrixManip. Be sure to output the results to the screen.

(c) Using a random number generator, populate two 5 x 5 matrices with numbers in the range from -30 to +50. Display your two arrays and the answers for part (a) above.

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!