Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //standard deviation
- #include<iostream>
- #include<iomanip>
- #include<math.h>
- using namespace std;
- double StepOne(int a, int b, int c, int d, int e){
- m1=double(a+b+c+d+e)/5.0;
- return m1;
- }
- double StepTwo(int & a, int & b, int & c, int & d, int & e, & StepOne()){
- a=double(POW(int a - m1, 2));
- return a, b, c, d, e;
- }
- double StepThree (int & a, int & b, int & c, int & d, int & e){
- sd= double(SQRT(a+b+c+d+e)/5.0)
- return sd;
- }
- int (FindR){
- double sd;
- if (sd<10);
- range=1;
- if (10<=sd<20);
- range=2;
- if (20<=sd)
- range=3;
- }
- int main()
- {
- cout<<"Welcome to Olivia's Standard Deviation Calculator!"<<endl;
- cout<<"Please enter 5 values:"<<endl;
- cin>>a, b, c, d, e;
- cout<<"The mean is"<<m1<<endl;
- cout<<"The standard deviation is"<<sd<<endl;
- if (range == 1);
- cout<<"range:low"<<endl;
- if (range == 2);
- cout<<"range:medium"<<endl;
- if (range == 3);
- cout<<"range:high"<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement