Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language: C99 Use array pointer notation struct statistics { int min; int max; int sum; }; Write the following functions: void stats(const int *a, int

Language: C99

Use array pointer notation

struct statistics { int min; int max; int sum; };

Write the following functions:

void stats(const int *a, int len, struct statistics *s) which mutates the fields of the struct statistics (see the starter file) so that the maximum, minimum and sum fields are the maximum, minimum and sum of the array elements in a respectively.

double mean(const int a[], int len) which returns the mean of the elements of the array.

double var(const int a[], int len) which returns the variance of the elements of the array.

int median(int a[], int len) which returns the median element of the array. Recall that the median of a list of numbers is the middle most element when the list is sorted. If there are an even number of elements, take the average of the middle two elements and round towards zero (ie. use integer division). Hint: You will need to mutate the array.

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

Database Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions

Question

9. To whom do I take a complaint, if I had one?

Answered: 1 week ago