-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
98 lines (73 loc) · 1.98 KB
/
main.cpp
File metadata and controls
98 lines (73 loc) · 1.98 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include <iostream>
using namespace std;
void mass(double body_mass,double daily_req)
{
double wgs,add_cals,t1,prot_coef,fats,B,T,W;
cout<<endl<<"Weight gaining speed [%/month]: ";
cin>>wgs;
wgs/=100;
t1=wgs*body_mass*7000;
add_cals=((wgs*body_mass/4)*t1)/7;
daily_req+=add_cals;
cout<<endl<<"Proteins coefficient: ";
cin>>prot_coef;
B=prot_coef*body_mass;
cout<<endl<<"Fats [%]: ";
cin>>fats;
fats/=100;
T=fats*daily_req/9;
W=(daily_req-(B*4+T*9))/4;
cout<<endl<<"Kcal: "<<(int)daily_req<<endl;
cout<<"B[g]: "<<(int)B<<endl;
cout<<"T[g]: "<<(int)T<<endl;
cout<<"W[g]: "<<(int)W<<endl;
}
void reduction(double body_mass,double daily_req)
{
double wls,subb_cals,prot_coef,fats,B,T,W;
cout<<endl<<"Weight loss speed [%/week]: ";
cin>>wls;
wls/=100;
wls*=body_mass;
subb_cals=wls*7000/7;
daily_req-=subb_cals;
cout<<endl<<"Proteins coefficient: ";
cin>>prot_coef;
B=prot_coef*body_mass;
cout<<endl<<"Fats [%]: ";
cin>>fats;
fats/=100;
T=fats*daily_req/9;
W=(daily_req-(B*4+T*9))/4;
cout<<endl<<"Kcal: "<<(int)daily_req<<endl;
cout<<"B[g]: "<<(int)B<<endl;
cout<<"T[g]: "<<(int)T<<endl;
cout<<"W[g]: "<<(int)W<<endl;
}
int main()
{
double body_mass,daily_req,act_coef;
int choice;
cout << "Total body mass [kg]: ";
cin>>body_mass;
cout<<endl<<"Multiplier: ";
cin>>act_coef;
daily_req=22*body_mass*act_coef;
cout<<endl<<"Zero [kcal]: "<<daily_req<<endl;
cout<<endl<<"1 -> Mass (high calories surplus)"<<endl;
cout<<"2 -> Reduce fat (calories deficit)"<<endl;
cout<<"What u wanna do: ";
cin>>choice;
switch(choice)
{
case 1:
mass(body_mass,daily_req);
break;
case 2:
reduction(body_mass,daily_req);
break;
default: return 0;
break;
}
return 0;
}