1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
harina [27]
3 years ago
5

Project 8:The Harris-Benedict equation estimates the number of calories your body needs to maintain your weight if you do no exe

rcise. This is called your basal metabolic rate, or BMR.The calories needed for a woman to maintain her weight is:BMR = 655 + (4.3 Ã weight in pounds) + (4.7 Ã height in inches) â (4.7Ã age in years)The calories needed for a man to maintain his weight is:BMR = 66 + (6.3 Ã weight in pounds) + (12.9 Ã height in inches) â (6.8 Ã age in years)A typical chocolate bar will contain around 230 calories. Write a program that allows the user to input his or her weight in pounds, height in inches, and age in years. 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.
Repeat the calorie-counting program described in Programming Project 8 from Chapter 2. This time ask the user to input the string "M" if the user is a man and "W" if the user is a woman. Use only the male formula to calculate calories if "M" is entered and use only the female formula to calculate calories if "W" is entered. Output the number of chocolate bars to consume as before.

Engineering
1 answer:
lilavasa [31]3 years ago
4 0

Answer:

See explaination and attachment for the program code and output

Explanation:

#include <iostream>

using namespace std;

int main()

{

char gender; //details for gender and checking

char ans;

do

{

cout<<"Gender (M or F): ";

cin>>gender;

switch(gender)

{

case 'M':

//cout<<"Male."<<endl;

break;

case 'F':

//cout<<"Female."<<endl;

break;

default:

cout<<"Wrong Gender. Please enter again (M or F): ";

cin>>gender;

}

int Weight,Height,Age; //declaration of variables

double bmr;

cout<<"Weight: ";

cin>>Weight;

cout<<"Height (in inches): ";

cin>>Height;

cout<<"Age: ";

cin>>Age;

//bmr calculations for male and female

if (gender = 'M')

{

bmr = 66 + (6.3 * Weight) + (12.9 * Height) - (6.8 * Age);

cout<<"He needs "<<bmr<<" to maintain his weight."<<endl;

cout<<"He needs to eat "<<(bmr/230)<< " candy bars in one day."<<endl;

}

else if (gender = 'F')

{

bmr = 655 + (4.3 * Weight) + (4.7 * Height) - (4.7 *Age);

cout<<"She needs "<<bmr<<" to maintain her weight"<<endl;

cout<<"She needs to eat "<<(bmr/230)<< " candy bars in one day."<<endl;

}

cout<< "Do you want to do another one>continue (Y/N): ";

cin >> ans;

}while(ans=='y'||ans=='Y');

cout<<"\n Thanks for using my BMR calculator. Good Bye!.";

return 0;

}

Kindly check attachment for output.

You might be interested in
23 PM Sat Apr 10
worty [1.4K]
Uhm I’m not understanding the question
4 0
3 years ago
15. A cold-chamber die-casting machine operates automatically, supported by two industrial robots.The machine produces two zinc
Softa [21]

Answer:

a. 121 Btu/lb

b. 211.8lb

c. 2.69/pc

Explanation:

See the attachments please

4 0
3 years ago
Read 2 more answers
ferry boat steamed along at 8 mph through calm seas, passenger casey exercised by walking the perimeter of the rectangular deck,
olga_2 [115]
Tell me why i got this question got it right and now won’t remember but i’ll get back at you when i remember
6 0
3 years ago
A 75 mm diameter, 15 mm wide A80-M12V grinding wheel is used for traverse surface grinding of a 75 mm by 75 mm 1040 steel workpi
Dmitrij [34]

Answer:

Detailed solution is given and calculations are done

3 0
3 years ago
Slovee plz asap<br> pzllzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
Triss [41]

Answer:

can you zoom in

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • A person puts a few apples into the freezer at -15oC to cool them quickly for guests who are about to arrive. Initially, the app
    15·1 answer
  • Calibrations on a recent version of an operating system showed that on the client side, there is a delay of at least 0.5 ms for
    13·1 answer
  • In natural convection, the fluid is forced to flow over a surface or in a tube by an external mean such as a pump or a fan. a)-
    10·1 answer
  • Write the syntax definitions of the following objects:
    9·1 answer
  • The following program includes fictional sets of the top 10 male and female baby names for the current year. Write a program tha
    9·2 answers
  • A drum contains 3 black balls, 5 red balls and 6 green balls. If 4 balls are selected at random what is the probability that the
    6·1 answer
  • Which of these parts of a cell phone is least likely to be found on the phone's circult board?
    5·1 answer
  • Is it realistic to build a tower with only 3 sheets of paper? why or why not
    14·2 answers
  • g A steam turbine is part of a power cycle. The flow rate of steam is 30 kg/s. If the steam entering the turbine is 5000C and ha
    12·1 answer
  • error: request for member 'setcursor' in 'oled', which is of non-class type 'adafruit ssd1306(int, int)' oled.setcursor(x, accel
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!