-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path*TDEE.cpp
More file actions
50 lines (48 loc) · 1.68 KB
/
Copy path*TDEE.cpp
File metadata and controls
50 lines (48 loc) · 1.68 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
#include <iostream>
using namespace std;
int main() {
cout << "Hi! This is calorie calculator." << endl
<< "It is based on Mifflin & St. Jeor formula for calculating basal metabolism and then calculate the TDEE." << endl;
//colecting data
cout << "Please, enter your weight: ";
float weight;
cin >> weight;
cout << "height: ";
float height;
cin >> height;
cout << "age: ";
float age;
cin >> age;
cout << "gender (m/f): ";
char gender;
cin >> gender;
cout << "Enter your activity level, where:" << endl
<< "1.2 - sedentary lifestyle" << endl
<< "1.375 - average activity (light exercise 1-3 times a week)" << endl
<< "1.55 - high activity (intensive exercise 3-5 times a week)" << endl
<< "1.725 - very high activity (heavy physical activity 6-7 times a week)" << endl
<< "Activity level: ";
float activity_level;
cin >> activity_level;
//calculating
float metabolism = (10 * weight) + (6.25 * height) - (5 * age);
switch (gender)
{
case 'm':
metabolism += 5;
cout << "Your basal metabolism: " << metabolism << " kcal." << endl
<< "Your TDEE: " << metabolism * activity_level << " kcal." << endl;
break;
case 'f':
metabolism -= 161;
cout << "Your basal metabolism: " << metabolism << " kcal." << endl
<< "Your TDEE: " << metabolism * activity_level << " kcal." << endl;
break;
default:
cout << "Invalid gender." << endl;
break;
}
cout << "Thank you for using. Bye!" << endl;
system("pause");
return 0;
}