Hi everyone,
we are supposed to be making a program on Metabolic Equivalents. where i input the activity, weight and pounds and the program outputs the calories. A Really straight forward program.
although I'm confused as to how to input this (1 kg = 2.2 pounds )
to be used in the equation for outputting calories
Calories/Minute = (.0175 * number METS * Weight (Kg) )
Also, i was introduced to the if else statements and i was wondering if it would be better to just ask the activity used first and create a different calorie equation involving the different activities because they have different Mets? Or does it not really matter.
I think you've not thought enough about what you actually want to do.
How will the user enter the information? Will the user be restricted to entering the information using certain units (i.e. must be pounds or kg, or can the user choose)? Can the user enter any values at all, or will you be restricting the values?
The user would enter the information in pounds and I'm supposed to input the conversion but i don't know how to do so. I've only learned basic input and outputs.
i wanted the user to enter the weight first, then activity and then how long the user was doing the activity and then the program will calculate the calories burned. I know how to introduce the questions, but i don't understand how to put the equation in
for instance, in the user put walking as the activity and 80 minutes in.
Calories/Minute = (.0175 * number METS * Weight (Kg) ) this would be the equation and walking is 2 Mets so would i make a seperate equation for Walking??
int main()
{
cout << "This is a program to measure your MEtabolic Equivalents (METS) \n";
cout << "As well as the calories burned \n";
double weight;
cout << "To Begin enter weight in pounds: "; cin >> weight;
weight /= 2.2;
char activity = 'n';
cout << "Enter activity as s for sleeping, w for walking, or b basketball: "; cin >> activity;
double METS;
switch(activity)
{
case 's':
METS = 1.0;
break;
case 'w':
METS = 2.0;
break;
case 'b':
METS = 8.0;
break;
default:
METS = 0.0;
}
double minute;
cout << "Lastly now enter the time in minutes of the activity you were engaging: \n" ;
cin >> minute;
double calories;
calories = (.0175*METS*weight*minute);
cout << "You have burned \n"
<< "calories" << "Good Job!" ;
return 0;
}
This is the program and everything seems to be fine except for the calories doesn't show. I'm sure i have identified everything properly. what is wrong?