Question: I'm using Microsoft Visual Studio the progam I have is not running, can you please help #include #include #include #include using namespace std; double mn;
I'm using Microsoft Visual Studio
the progam I have is not running, can you please help
#include
#include
#include
#include
using namespace std;
double mn;
double mean(const double x[], int size);
double deviation(const double x[], int size);
int main(void)
{
double x[10];
int i;
cout
for (i = 0; i
{
cin >> x[i];
}
mn = mean(x, 10);
cout
cout
system("pause");
return 0;
}
double mean(const double x[], int size)
{
double sum = 0, m;
int i;
for (i = 0; i
{
sum = sum + x[i];
}
m = sum/size;
return m;
double deviation(const double x[], int size)
{
double s = 0, sum2 = 0, sd, m, d;
int i;
for (i = 0; i
{
d = (x[i] - mn)*(x[i] - mn);
sum2 += d;
}
s = sum2 / (size - 1);
sd = sqrt(s);
return sd;
}
}
(Statistics: compute deviation) Programming Exercise computes the standard deviation of numbers. This exercise uses a different but equivalent formula to compute the standard deviation of n numbers mean) x1 x2 mean deviation To compute deviation with this formula, you have to store the individual numbers using an array, so that they can be used after the mean is obtained Your program should contain the following functions: Compute the mean of an array of double values double mean(const double XO, int size)// Com Write a test program that prompts the user to enter 10 numbers and displays the mean and deviation, as shown in the following sample run: Enter ten numbers: 1.9 2.5 3.7 2 1 6 3 4 5 2 Enter The mean is 3.11 The standard deviation is 1.55738
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
