Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1 (15 points) Write a program that returns the minimum value and its location, max value and its location and average value of an

image text in transcribed
Problem 1 (15 points) Write a program that returns the minimum value and its location, max value and its location and average value of an array of integers. Your program should call a single function that returns that min and its location, max and its location and mean value of the array. Print the results in the main function (not within the array_func function). See sample code execution below. The declaration of this function is given below: void array_func (int *x, int size, int *min_p, int *minloc_p, int *max_p, int *maxloc_p, double *mean_p) /* x is a pointer to the first array element size is the array size min_p is a pointer to a variable min in the main function that holds the minimum minloc_p is a pointer to a variable minloc in the main function that holds the location where the minimum is. max _p is a pointer to a variable max in the main function that holds the maximum maxloc_p is a pointer to a variable maxloc in the main function that holds the location where the maximum is mean_p is a pointer to a variable mean in the main function that holds the mean Declare the following array of integers within the main function: int data_arl -3, 5, 6, 7, 12, 3, 4, 6, 19, 23, 100, 3, 4, -2, 9, 43, 32, 45, 32, 2, 3, 2, -1, 8 ); int data_ar2] -679,-758, -744,-393,-656,-172,-767,-32,-277,-47,-98, -824, -695, 318,-951,-35,-439,-382,-766,-796,-187,-490, -446,-647); 269.57909128371499, 1139, 25, 17, 75, -27, 158, 48, 33, 67, 9, 89, 33, 78, -180, 186, 218, -274) Sample code execution: 3 5 6 7 12 3 4 6 19 23 1e0 3 4 -29 43 32 45 32 2 32 -1 8 nax - 180 at index 10, min 3 at index e, mean 15.8833 679 -758 744 -393 -656 -172 -707 -32 -277 -47-98-824 -695 -318 -951 -35 -439 -382 -766 -796 -187 max - 32 at index 7, min-951 at index 14, mean 480.7917 -498 -446-647 142 -2-56-68 114 -249 45-139-25 17 75 -27 158 -48 33 67 9 89 33 -78 -180 186 218 -27 nax 218 at index 22, min- 274 at index 23, mean -9.8333

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe donated capital.

Answered: 1 week ago

Question

Apply interpersonal-related tactics for effective team play.

Answered: 1 week ago