Answered step by step
Verified Expert Solution
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
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 providedStep 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