aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ee1301/wk2/lab2/bmr.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/ee1301/wk2/lab2/bmr.cpp b/ee1301/wk2/lab2/bmr.cpp
index a01b282..ec8af20 100644
--- a/ee1301/wk2/lab2/bmr.cpp
+++ b/ee1301/wk2/lab2/bmr.cpp
@@ -19,17 +19,18 @@ int main () {
cout << "Enter height in inches:"; cin >> height;
cout << "Enter age in years:"; cin >> age;
cout << "Enter Sex(M/F)"; cin >> s;
-
- if (s=='M' || s=='m'){
- BMR = 66 + (6.3 * weight) + (12.9 * height) - (6.8 * age);
- cout << "Your BMR is: " << BMR;
- }
-
+
if (s=='F' || s=='f'){
BMR = 655 + (4.3 * weight) + (4.7 * height) - (4.7 * age);
cout << "Your BMR is: " << BMR;
}
+
+ if (s=='M' || s=='m'){
+ BMR = 66 + (6.3 * weight) + (12.9 * height) - (6.8 * age);
+ cout << "Your BMR is: " << BMR;
+ }
+
chocolate = BMR/230;
cout << endl << "Number of 230 Calories bars you can have is: " << chocolate << endl;
return 0;
-} \ No newline at end of file
+}