-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha.cpp
More file actions
38 lines (38 loc) · 864 Bytes
/
Copy patha.cpp
File metadata and controls
38 lines (38 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "a.h"
Bmi::Bmi() { mess = 0; height = 0;}
float Bmi::getmess() {
return mess;
}
float Bmi::getheight() {
return height;
}
void Bmi::setmess(float m) {
mess = m;
}
void Bmi::setheight(float h) {
height = h;
}
float Bmi::returnbmi() {
return Bmi::getmess() / Bmi::getheight() / Bmi::getheight() * 10000;
}
string Bmi::category() {
float bmi = mess/height/height*10000;
string a;
if(bmi<15.0)
a = "Very severely underweight";
else if(bmi>15.0 && bmi<16.0)
a = "Severely underweight";
else if(bmi>16.0 && bmi<18.5)
a = "Underweight";
else if(bmi>18.5 && bmi<25.0)
a = "Normal";
else if(bmi>25.0 && bmi<30.0)
a = "Overweight";
else if(bmi>30.0 && bmi<35.0)
a = "Obese Class I (Moderately obese)";
else if(bmi>35.0 && bmi<40.0)
a = "Obese Class II (Severely obese)";
else
a = "Obese Class III (Very severely obese)";
return a;
}