Advertisement
payjack

Untitled

Sep 28th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.03 KB | None | 0 0
  1. //standard deviation
  2.  
  3. #include<iostream>
  4. #include<iomanip>
  5. #include<math.h>
  6.  
  7. using namespace std;
  8.  
  9. double StepOne(int a, int b, int c, int d, int e){
  10.  
  11.     m1=double(a+b+c+d+e)/5.0;
  12.     return m1;
  13. }
  14.  
  15. double StepTwo(int & a, int & b, int & c, int & d, int & e, & StepOne()){
  16.  
  17.     a=double(POW(int a - m1, 2));
  18.     return a, b, c, d, e;
  19.  
  20. }
  21.  
  22. double StepThree (int & a, int & b, int & c, int & d, int & e){
  23.     sd= double(SQRT(a+b+c+d+e)/5.0)
  24.     return sd;
  25. }
  26.  
  27. int (FindR){
  28.  
  29.     double sd;
  30.     if (sd<10);
  31.         range=1;
  32.     if (10<=sd<20);
  33.         range=2;
  34.     if (20<=sd)
  35.         range=3;
  36. }
  37. int main()
  38. {
  39.     cout<<"Welcome to Olivia's Standard Deviation Calculator!"<<endl;
  40.     cout<<"Please enter 5 values:"<<endl;
  41.     cin>>a, b, c, d, e;
  42.    
  43.       cout<<"The mean is"<<m1<<endl;
  44.     cout<<"The standard deviation is"<<sd<<endl;
  45.     if (range == 1);
  46.         cout<<"range:low"<<endl;
  47.     if (range == 2);
  48.         cout<<"range:medium"<<endl;
  49.     if (range == 3);
  50.         cout<<"range:high"<<endl;
  51.  
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement