Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c programming seashell LANGUAGE FEATURES: For this question, you may use the double type Write the following two functions (in two separate programs) Both functions

c programming seashell

image text in transcribed

LANGUAGE FEATURES: For this question, you may use the double type Write the following two functions (in two separate programs) Both functions read ints until a failure occurs and return the number of ints successfully read. If no ints were successfully read in, the functions return zero and do not modify (mutate) the contents of any of the parameters. Otherwise, the functions mutate the contents of their (pointer) parameters as follows: a. int read_and_range(int "max, int *min, int "count_max, int *count_min) *max: the largest number that was successfully read o o *min: the smallest number that was successfully read *count_max: the number of times the largest number was read o count_min: the number of times the smallest number was read b. int read_and_calc_stats(int sum, double "mean, double *var) o sum: the sum of the numbers that were successfully read o *mean: the average of the numbers that were successfully read o *var: the variance of the numbers that were successfully read (see below) To calculate the mean and variance of a population of N members x1 .. XN, use the formulas: mean -(x1+xN)/N variance (x12 + +xN2)/N - (mean)2 If N is one, then the variance is zero. PRO TIP: To calculate the value of a/b as a double, where a and b are both ints, do not simply write double result - al bi as that will still use integer division. Instead, write: double result = a; result- result /b; ASIDE: If you're curious, there is an alternative formula for calculating the variance of a sample using (N 1) instead of (N). You can read about this idea called Bessel's correction. For this question, the marmoset basic tests ("public" tests) will use the main function and simple test files provided

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 Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Showcase your strengths in a rsum

Answered: 1 week ago

Question

1. Identify what positions are included in the plan.

Answered: 1 week ago