Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1st Code: 1) Write a function to compute the average of allitems in a double arr

ID: 3618320 • Letter: 1

Question

1st Code:

1)  Write a function to compute the average of allitems in a double array and return that value. The functionshould not print anything. The header for this functionshould be

    doublearrayAverage(double arr1[], int numItems);

2)     In Main, read as sequence of double values from the input into adouble array. You should not ask the user how many valuesthere are, just read until there are no more.

Then call the function defined aboveand print the value returned, with appropriate comments.

2nd Code:

a)      Write a function to find andreturn the value in a double array that is closest in absolutevalue to the average of the values in the array. Thisfunction should not print anything.

b)      Have main call the function andprint the results.

Explanation / Answer

please rate - thanks #include #include using namespace std; double arrayAverage(double [], int ); double closest(double [] ,int ,double ); int main() {double num[100],avg; int i=0,j; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote