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
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