Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In c please , as simple code as possible ho reed to priett or scanf your name, just write it downl Major Q1. A truncated
In c please , as simple code as possible ho reed to priett or scanf your name, just write it downl Major Q1. A truncated mean or trimmed mean is a statistical measure of central tendency. It involves the calculation of the mean after discarding a given number of samples (values) at the high and low end (back and front). This number of samples to be discarded is usually given as a percentage of the total number of points. (25 pts) Create a function named trimmedMean following all constraints specified below: a) b) c) d) e) Receives an array of integer numbers. Receives the size of the array (how many elements the array contains). Receives the percentage (0-100%) of samples to discard in the low end (front). Receives the percentage (0-100%) of samples to discard in the high end (back). Verifies that all percentages sent are valid and the number of elements discarded is not greater than the size of the array. For any invalid condition return 0. Returns the truncated or trimmed mean of the array of integers. (EXTRA 5 pts) Suppose you have a function to compute the ordinary mean named calcAvg as the one shown below. Given the percentages for discarding samples from the lower and higher end (lowPct and highPct) and using a call to the function calcAvg, compute the trimmed mean. #include #include double calcAvg(int nums[], int n) double avg .8; for (int i e; in; in) avg + nums[i]: return avg n; int main(void) int N; scanf("%d", BN) ; numbers (int') malloc(sizeof (int). N); for (int i = e; n; i++) numbers(i)-rand() % 231; printf("In") int lowPct, highPct; scanf("Xd-, &IoPct); // assume the user inputs a proper % scanf("xd., &highPct); // assume the user inputs a proper % I Compute the trimmed mean calling the function calcAvg
In c please , as simple code as possible
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