Write a program that takes as input five numbers and outputs

Write a program that takes as input five numbers and outputs the mean (average) and standard deviation of the numbers. If the numbers are x1,x2,x3,x4, and x5, then the mean is x = (x1+x2+x3+x4+x5)/5 and the standard deviation is: Image result for standard deviation formula Please let N =5 be the termination The program must contain at least the following functions: a function that calculates and returns the mean and a function that calculates the standard deviation.

Please use C++ Visual Studio 2013 for this problem

Solution

#include<iostream.h>

#include<stdio.h>

void main()

{

int sum = 0;

int calculateMean(int s);

for(i=0;i<5;i++)

{

cout<<\"Please enter the numbers\";

cin>>n;

arr[i]=n;

sum = sum+arr[i];

}

mean = calculateMean(sum);

cout<<\"Mean of entered numbers is\"<<mean<<endl;

}

int calculateMean(int s)

{

int mean;

mean = sum/5;

return mean;

}

Write a program that takes as input five numbers and outputs the mean (average) and standard deviation of the numbers. If the numbers are x1,x2,x3,x4, and x5, t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site