Question: Note !!!!!!!! just help me to complete the 20% winsorized please, it just lacks this part. for 20% winsorized i think we should order these
Note !!!!!!!! just help me to complete the 20% winsorized please, it just lacks this part. for 20% winsorized i think we should order these five integers from smallest to largest. I will provide my code.
Thank you very much!
Write a C++ program that will ask the user to enter 5 integers and then calculate their arithmetic mean, geometric mean, harmonic mean, and standard deviation. The program should then print and label the original 5 numbers and the four statistics.
Note:
- All means should be rounded to two decimal places.
- Echo Print input
Arithmetic Mean

Geometric Mean

Harmonic Mean

Standard Deviation

Here is a sample of what you program should do.
Enter five numbers: 85 43 95 100 78 Result: Data: 85 43 95 100 78 Arithmetic Mean = 80.20 Geometric Mean = 77.01 Harmonic Mean = 73.13 Standard Deviation = 20.11 Root Mean Square = 36.30 20% Winsorized Mean = 34.20
Enter five numbers: 171 363 48 254 340
Result:
Data:
171
363
48
254
340
Arithmetic Mean = 235.20
Geometric Mean = 191.47
Harmonic Mean = 137.69
Standard Deviation = 115.62
Root Mean Square = 262.08
20% Winsorized Mean = 255.20
#include #include #include
using namespace std;
int main() { double num1=0, num2=0, num3=0, num4=0, num5=0; double sum=0, prod=0, sum1=0, diff=0; double ArithmeticMean=0, GeometricMean=0, HarmonicMean=0, StdDeviation=0; double rootMeanSquare=0; double winsorizedMean=0;
cout
sum = num1+num2+num3+num4+num5; ArithmeticMean = sum/5;
prod = num1*num2*num3*num4*num5; GeometricMean = pow(prod,0.2);
sum1 = (1um1)+(1um2)+(1um3)+(1um4)+(1um5); HarmonicMean = 5/sum1;
diff = pow((num1-ArithmeticMean),2) + pow((num2-ArithmeticMean),2) + pow((num3-ArithmeticMean),2) + pow((num4-ArithmeticMean),2) + pow((num5-ArithmeticMean),2);
StdDeviation = sqrt((diff/5));
rootMeanSquare = sqrt((pow(num1,2) + pow(num2,2) + pow(num3,2) + pow(num4,2) + pow(num5,2)) / 5.0);
cout
Y7 } (Tt az)= va *02 * ... On i=1 ? 10 401 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
