Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The Harris-Benedict equation estimates the number of calories your body needs to

ID: 3538841 • Letter: T

Question

The Harris-Benedict equation estimates the number of calories your body needs to maintain your weight if you do not exercise. This is called your basal metabolic rate, or BMR. The calories needed of a woman to maintain her weight is: BMR = 655 + (4.3 x weight in pounds) + (4.7 x height in inches) - (4.7 x age in years) The calories needed of a man to maintain his weight is: BMR = 66 + (6.3 x weight in pounds) + (12.9 x height in inches) - (6.8 x age in years) A typical chocolate bar will contain around 230 calories. Write a program in C++ in Microsoft Visual Studio 2010 that allows the user to input the weight, height, and age. The program should then output the number of chocolate bars that should be consumed to maintain one's weight for both a woman and a man of the input weight, height, and age. The Harris-Benedict equation estimates the number of calories your body needs to maintain your weight if you do not exercise. This is called your basal metabolic rate, or BMR. The calories needed of a woman to maintain her weight is: BMR = 655 + (4.3 x weight in pounds) + (4.7 x height in inches) - (4.7 x age in years) The calories needed of a man to maintain his weight is: BMR = 66 + (6.3 x weight in pounds) + (12.9 x height in inches) - (6.8 x age in years) A typical chocolate bar will contain around 230 calories. Write a program in C++ in Microsoft Visual Studio 2010 that allows the user to input the weight, height, and age. The program should then output the number of chocolate bars that should be consumed to maintain one's weight for both a woman and a man of the input weight, height, and age.

Explanation / Answer


//CODE TESTED IN MS VSIUAL STUDIO


#include <iostream>

#include <string>

using namespace std;

  

int main() {

double wt,ht,age,bmrMan,bmrWoman;

cout<<"Enter weight in pounds:"<<endl;

cin >> wt;

cout<<"Enter height in inches:"<<endl;

cin >> ht;

cout<<"Enter age in years:"<<endl;

cin >> age;


bmrWoman= 655 + (4.3 * wt) + (4.7 * ht) - (4.7 * age);

bmrMan= 66 + (6.3 * wt) + (12.9 * ht) - (6.8 * age);


cout<<"The calories needed of a woman to maintain her weight is: "<<bmrWoman<<endl;

cout<<"The number of chocolate bars that should be consumed to maintain one's weight for woman is: "<<(bmrWoman/230.0)<<endl;

cout<<"The calories needed of a man to maintain her weight is: "<<bmrMan<<endl;

cout<<"The number of chocolate bars that should be consumed to maintain one's weight for man is: "<<(bmrMan/230.0)<<endl;

return 0;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote