From 2c5cef21acb1209c4fb0063737aeb6f93ed0aece Mon Sep 17 00:00:00 2001 From: Matthew Strapp Date: Wed, 13 Feb 2019 14:41:45 -0600 Subject: Always check your code kiddos --- ee1301/wk2/lab2/bmr.cpp | 15 ++++++++------- 1 file 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 +} -- cgit v1.2.3