Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PART I: Program Setup Use the attached code as a starting point for your program. This program is designed to assist you in interactively reading

PART I: Program Setup Use the attached code as a starting point for your program. This program is designed to assist you in interactively reading from the keyboard a 2 dimensional array (or matrix) with a maximum of ROWS and COLS as indicated. Type this code exactly into your program to start part II. [2 marks] PART II: Functions and Calculations 1. Write a function called Print that takes three parameters: the array to be printed, and the number of rows and cols you want to print. The function displays the values to the standard output in a table format. Floating values are displayed with 2 decimal places. Each row is shown on a separate line. The function has no return type. [2 marks] 2. Write a function called AverageOfColumns that adds the numbers in each column and stores the resulting average values from each column in the next (bottom) row (allow that the number of rows available is one more than that used for the actual array). As parameters it takes the array (matrix), and the number of rows and columns it contains. [2 marks] 3. Write a function called PrintStatistics that is called after AverageOfColumns is called and examines the results stored in the last computed row and reports the column number of the ones with the smallest and largest sums as shown in the example. [2 marks] PART III: Sample output of PrintStatistics (your code should work for any size array up to ROWS and COLS) Input: 1.00 4.00 3.00 Output: 1.00 4.00 3.00 4.00 1.00 2.00 4.00 1.00 2.00 2.00 4.00 5.00 2.00 4.00 5.00 2.33 3.00 3.33 Column 3 is the largest Column 1 is the smallest

#include #define ROWS 21 #define COLS 20 void main () { int p, q ; int rows, cols ; float A [ ROWS ] [ COLS ] ; printf( "Enter # of rows, # of cols: " ) ; scanf ( "%d%d", &rows, &cols ) ; for ( p=0; p

}

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 Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

List some common internal controls for accounts receivable.

Answered: 1 week ago

Question

Detailed note on the contributions of F.W.Taylor

Answered: 1 week ago