Question: Project 5: Array Programming Given the following starter code: #include /* function declarations - CS 50 Students need to implement these functions */ double getAverage(int
Project 5: Array Programming
Given the following starter code:
#include
/* function declarations - CS 50 Students need to implement these functions */
double getAverage(int arr[], int size);
int getMaximum(int arr[], int size);
int getMinimum(int arr[], int size);
int main () {
/* an int array with 5 elements */
int array[5] = {1000, 2, 3, 17, 50};
double avg, min, max;
/* pass an array as an argument with its companion size parameter */
avg = getAverage( array, 5 ) ;
min = getMinimum( array, 5 );
max = getMaximum( array, 5 );
/* output the returned value */
printf( "Average value is: %f ", avg );
printf( "Minimum value is: %d ", min );
printf( "Maximum value is: %d ", max );
return 0;
}
Please complete the three different functions that have been stubbed out. By doing so, you will be working with arrays and array arguments. I have supplied some sample output to help you understand the kind of code I am looking for.
SAMPLE RUN
Average value is: 214.4
Minimum value is: 2
Maximum value is: 1000
I need this in C program
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
