Computer science homework 10

xx261953122

CS111 Assignment 10

Those programs (without errors) submitted by 5/17/2016 will be given full score.


Write a complete C++ program that will contain the following:


a.Create a 2-dimensional array with 10 rows and 10 columns; Fill the array with random 3digit integers.


b.findLargestSum will return the column with the largest sum. If two or more columns,share the largest sum, print out only one column.


c.findSmallestValue will return the smallest value within the given 2d array.


d.subtractAverage will calculate the average of the entries in a 2d array and subtracts thisaverage from every entry of the array.


For example, the main program may run as follows:


int main () {


     int array2[][2] = { {1, 2}, {3, 4}, {2, 3}, {9, 9} };

     cout << findLargestSum(array2, 4, 2) << endl; // prints 18

     cout << findSmallestValue(array2, 4, 2) << endl; // prints 1

     subtractAverage(array2, 4, 2);

     return 0;
}

    • 10 years ago
    • 10
    Answer(2)

    Purchase the answer to view it

    NOT RATED
    • screenshotarray.png
    • array.rar

    Purchase the answer to view it

    NOT RATED
    • screenshot_cplusassignment.jpg
    • cplusassignment.zip