sample program ***utilize a two-dimensional integer array. The array will have 2
ID: 3638420 • Letter: S
Question
sample program***utilize a two-dimensional integer array. The array will have 20 rows and 15 columns. The data for the array can be created with .txt file of your own.
***The program should load the data into the array from the .txt file.
***The program must have 6 functions (plus other functions related to file manipulation, menu display and processing, etc.) that perform the following tasks:
1.An integer-returning function that will find the sum of all the values in the array and return that result to the calling function.
2.A double-returning function that will find the average of all the values in the array and return that result to the calling function.
3.An integer-returning function that will find the sum of all the values in one row of the array. The row will be specified by the user. The result should be returned to the calling function.
4.An integer-returning function that will find the sum of all the values in one column of the array. The column will be specified by the user. The result should be returned to the calling function.
5.An integer-returning function that will find the highest value in a row specified by the user. The result should be returned to the calling function.
6.An integer-returning function that will find the lowest value in a row specified by the user. The result should be returned to the calling function.
***When asking the user for a row or column value, keep in mind that the user will enter the row or column number and NOT the index for that row or column. Also, do not allow the user to enter a row or column number that would result in an invalid index.
***The program should be menu-driven and continue to run until the user signals he/she is ready to quit. Keep in mind, however, that the data from the file only needs to be loaded one time, before the menu is displayed for the first time.
Explanation / Answer
#include #include #include using namespace std; int sum(int a[20][15]) { int sum=0; for(int i=0;iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.