Question: Write a C + + program that will have a 2 - Dimensional array with 5 rows and 4 columns and will contain integer data.
Write a C program that will have a Dimensional array with rows and
columns and will contain integer data. You may initialize array with data when
declared the array.
Your program should have the following functions:
a getTotal will accept the D array and return total of all values in the
array. The size of array will be a constant global value.
b getAverage will accept the D array and return average of all values in
the array. The size of array will be a constant global value.
c getRowTotal the first argument will be a D array, and an integer as the
second argument to indicate which row to work on Return the total of row
specified in the argument. This function should be called only if the value for
the row entered by user is valid.
d getColumnTotal the first argument will be a D array, and an integer as
the second argument to indicate which column to work on Return the total
of column specified in the argument. This function should be called only if
the value for the column entered by user is valid.
e getHighestInRow the first argument will be a D array, and an integer
as the second argument to indicate which row to work on Return the largest
value of row specified in the argument. This function should be called only if
the value for the row entered by user is valid.
f getLowestInColumn the first argument will be a D array, and an integer
as the second argument to indicate which column to work on Return the
smallest value of column specified in the argument. This function should be
called only if the value for the column entered by user is valid.
Lastly, print all the values returned by each of the function indicated above. Add
descriptive text to describe the value printed.
Add preconditions and postconditions documentation to your function
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
