aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Strapp <msattr@gmail.com>2019-02-13 14:41:45 -0600
committerMatthew Strapp <msattr@gmail.com>2019-02-13 14:41:45 -0600
commit2c5cef21acb1209c4fb0063737aeb6f93ed0aece (patch)
tree3c4761225b8262e115c43c7fdee09d7995c6e8fd
parentOne last time! (diff)
downloadhomework-2c5cef21acb1209c4fb0063737aeb6f93ed0aece.tar
homework-2c5cef21acb1209c4fb0063737aeb6f93ed0aece.tar.gz
homework-2c5cef21acb1209c4fb0063737aeb6f93ed0aece.tar.bz2
homework-2c5cef21acb1209c4fb0063737aeb6f93ed0aece.tar.lz
homework-2c5cef21acb1209c4fb0063737aeb6f93ed0aece.tar.xz
homework-2c5cef21acb1209c4fb0063737aeb6f93ed0aece.tar.zst
homework-2c5cef21acb1209c4fb0063737aeb6f93ed0aece.zip
Always check your code kiddos
Diffstat (limited to '')
-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
+}