Here is my code
CODE
#include <iostream> //access cout
#include <cmath> // access power functions
#include <iomanip> // access fixed and setprecision
using namespace std;
int main()
{
int number1, number2, number3, number4;
float mean;
float standardDeviation;
const float N = 4.0;
//put output for formatting
cout << fixed << setprecision(2);
//input the four numbers
cout << "Input the 1st number: ";
cin >> number1;
cout << "Input the 2nd number: ";
cin >> number2;
cout << "Input the 3rd number: ";
cin >> number3;
cout << "Input the 4th number: ";
cin >> number4;
//calculate the mean and output the mean
mean = ((number1 + number2 + number3 + number4)/N);
cout << "The mean of these numbers is: " << mean << endl;
cout << endl;
//calculate standard deviation and output standard deviation
standardDeviation = sqrt((pow(number1-mean,2) + pow(number2-mean,2) +
pow(number3-mean,2) + pow(number4-mean,2)/ (N-1);
cout << "The standard deviation is: " << standardDeviation << endl;
cout << endl;
cin.get(); //type enter to end
cin.get(); //type enter to end
}
I tried using the .get twice, but still now luck, it pops up and off, I tried the pause and the get ch one but no luck. I have no idea if my code is even correct.
edit: added [code] tags ~ jayman9