Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can someone help me wth this urgently/? This question uses Matrix defined below: struct Matrixf int table [50] [50]; // a square matrix int size;

can someone help me wth this urgently/?

image text in transcribed
This question uses Matrix defined below: struct Matrixf int table [50] [50]; // a square matrix int size; // the actual number of rows and columns Write a function that takes a Matrix structure and does the following: . It calculates the sum of elements located below the left-right diagonal and replaces the element in the last row and first column with this value. . It calculates the average of elements located below the left-right diagonal. . It calculates the average of elements located above the left-right diagonal. . It also replaces the elements on the left-right diagonal with Os. Example: 50 1 2 20 5 10 5 3 90 Sum below diagonal is: 2 + 1 + 5 + 6 + 7 + 3 = 24 Average below diagonal is: 24/6 = 4.0 Sum above diagonal is: 1 + 2 + 3 + 6 + 4 + 5 = 21 Average above diagonal is: 21/6 = 3.5 Updated matrix: 1 2 3 2 5 0 5 24 3 0 // In main( ) Matrix mt; // assume it contains data double aveA; // average below diagonal double avgB; // average above diagonal // Here is a calling statement: testMatrix(mt, avgA, avgB); Question: Is there any advantage of placing a 2D array and its size in a structure? Write the answer to this question as a comment in the beginning of the file, next to your name: //

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions