help needed

hello,
i am a university student taking the first c++ course but my major is civil engineering (it is a core requirement) so i am not so good the professor gave us an assignment that is due tomorrow and i didnt know how to do it i was wondering if anyone could help me out. It should be pretty basic for you guys.

the problem is :
Implement WEIGHT CONTROL, a weight management program for safe weight loss.
The program helps the user to maintain a sufficient calorie intake. When the program is started it asks for the user’s height in centimeters, weight in kilograms, age and gender (M or F) and based on the given information the BEE (which stands for the basal energy expenditure) is calculated using one of the following equations
For MEN BEE = 66.5 + (13.75 x kg) + (5.003 x cm) - (6.775 x age)
WOMEN BEE = 655.1 + (9.563 x kg) + (1.850 x cm) - (4.676 x age)

Since BEE gives the amount of calories you need while lying in bed all day, the result must be scaled in order to get the total daily energy expenditure TDEE. This is done by multiplying the BEE with a suitable value depending on the user’s activity level. The user’s activity level must also be inputted.

As such If the activity level is
S for sedentary (desk job, no exercise) multiply BEE by 1.2
L for lightly active (exercise 1-3 days/week) multiply BEE by 1.375
M for moderately active (exercise 3-5 days/week) multiply BEE by 1.55
V for very active (exercise 6-7 days/week) multiply BEE by 1.725
E for extremely active (daily exercise and physical job or professional athlete) multiply BEE by 1.9

So now you have the BEE and the TDEE values and the safe way to lose weight is to keep the daily calorie intake always above BEE and at most 500 calories below TDEE. The TDEE should naturally not be exceeded either.

After printing the BEE value and the TDEE value a prompt “>” is printed for the user and the program waits for the user’s commands. The allowed commands are described below:
Command Behavior
+ val1 val2 after the plus you must enter two values the amount of
food eaten in grams (val1) and how much energy the food contains per 100 grams (val2 In Kilocalories). Then you multiply to get the intake of energy for that food item. Each time a command of the sort is invoked the resulting value must be added to the daily intake of energy.

H for help, it prints the operators and their meaning
C prints the BEE, TDEE and the current daily energy intake on the screen
Q quits the program after printing the daily energy intake
in addition to how the day went compared to the BEE and TDEE values




thanks in advance

Have you tried anything? Post what you have done so far, and we can help you.
#include <iostream.h>
int main()
{
int height , weight , age , bee , tdee;
char gender;
cout<<"Enter your height, weight , age respectivley"<<endl;
cin>> height>>weight>>age;
Cout<<"please specify ur gender m for male f for female"<<endl;
cin>>gender>>endl;
if(gender=m)
cout<<"your BEE is:"<< bee=(66.5+(13.75*weight)+(5.003*height))-(6.775*age)<<endl;
else
cout<<"your BEE is:"<< bee=(655.1+(9.563*weight)+(1.85*height))-(4.676*age)<<endl;
char activity;
cout<<"please enter ur activity level (s for sedentary , l for lightly active , m for moderatly active , v for very active , e for extremely active)<<endl;
cin>>activity;
switch (activity){
case s:
cout<<tdee=bee*1.2<<endl;
break;

case l:
cout<<tdee=bee*1.375<<endl;
break;

case m:
cout<<tdee=bee*1.55<<endl;
break;

case v:
cout<<tdee=bee*1.725<<endl;
break;

case e:
cout<<tdee=bee*1.9<<endl;
break;
Last edited on
plz note that i did this on note pad i dont have the c++ program on my computer and its a sunday i cant go use one of the university's computers.

i didnt know how to continue the last part about the commands and behavior
Last edited on
i dont have the c++ program on my computer


You've got the internet. Download one.

There's a discussion of various options towards the end of this:
http://www.cplusplus.com/articles/36vU7k9E/
Last edited on
Topic archived. No new replies allowed.