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

Write a function that returns the mean value of a number of integers in an array

ID: 3613038 • Letter: W

Question

Write a function that returns the mean value of a number of integers in an array. This array is passed to the function. The function prototype is: double get Mean (constant values[ ]); The size of the array is 20 and has been defined by: #define MAX_N0_VALUES 20 Assume that the end of the valid data is defined by a sentinel having the value 0. That is: #define SENTINEL 0 Your loop must test not only for the sentinel value but also the end of the array. That is, your function must ensure that it does not read off the end of the array if the sentinel value is not in the array.

Explanation / Answer

please rate - thanks #include #include #define MAX_NO_VALUES 20 #define SENTINEL 0 double getMean(const int values[]); int main() {int array[MAX_NO_VALUES],i=0,kt; printf("Enter number %d (0 to exit): ",(i+1)); scanf("%d",&array[i]); while(i
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