Facebook
From Baby Horse, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 205
  1. cout << "Hello world!" << endl;
  2.     double mass, height, BMI;
  3.     cout << "mass? :(kg)"; cin >> mass;
  4.     cout << "height? :(m)"; cin >> height;
  5.  
  6.     BMI=mass/pow(height,2);
  7.     cout << "BMI?" << BMI<<endl;
  8.     if(BMI<16) // -------------------------------------------------start of the block
  9. {
  10.     cout << "severly underweight" << endl;
  11. }
  12.     else if (BMI >16 && BMI <=18.5)
  13.      {
  14.          cout<< "underweight"<< endl;
  15.      }
  16.     else if (BMI >18.5 && BMI <=25)
  17.     {
  18.         cout<< "normal" <<endl;
  19.     }
  20.     else if (BMI >25 && BMI <=30)
  21.     {
  22.         cout<< "overweight" << endl;
  23.     }
  24.     else
  25.     {
  26.         cout<<" you are fat" << endl;
  27.     }
  28.  
  29. //--------------------------------------------------------end of the block