Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started