Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q2 (40 pts). A truncated mean or trimmed mean is a statistical measure of central tendency. It involves the calculation of the mean after
Q2 (40 pts). 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. Requirements a) Create a function named trimmedMean following all constraints specified below: - - - - - 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 discarded in the low end (front). Receives the percentage (0-100%) of samples to discarded in the high end (back). In your function verify 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.
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