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
One kilogram of water fills a 150-L rigid container at an initial pressure of 2 MPa. The container is then cooled to 40∘C. Deter
lukranit [14]

The pressure of water is 7.3851 kPa

<u>Explanation:</u>

Given data,

V = 150×10^{-3} m^{3}

m = 1 Kg

P_{1} = 2 MPa

T_{2}  = 40°C

The waters specific volume is calculated:

v_{1} = V/m

Here, the waters specific volume at initial condition is v_{1}, the containers volume is V, waters mass is m.

v_{1} = 150×10^{-3} m^{3}/1

v_{1} = 0.15 m^{3}/ Kg

The temperature from super heated water tables used in interpolation method between the lower and upper limit for the specific volume corresponds 0.15 m^{3}/ Kg and 0.13 m^{3}/ Kg.

T_{1}= 350+(400-350) \frac{0.15-0.13}{0.1522-0.1386}

T_{1} = 395.17°C

Hence, the initial temperature is 395.17°C.

The volume is constant in the rigid container.

v_{2} = v_{1}= 0.15 m^{3}/ Kg

In saturated water labels for T_{2}  = 40°C.

v_{f} = 0.001008 m^{3}/ Kg

v_{g} = 19.515 m^{3}/ Kg

The final state is two phase region v_{f} < v_{2} < v_{g}.

In saturated water labels for T_{2}  = 40°C.

P_{2} = P_{Sat} = 7.3851 kPa

P_{2} = 7.3851 kPa

7 0
3 years ago
Which statement most accurately describes Pascal's law?
marin [14]

Answer:

La  C

Explanation:

7 0
3 years ago
Read 2 more answers
List all the qualities of an engineer?
Dennis_Churaev [7]

Answer:

Math and Computer Skills. A qualified engineer should be good at math, at least through the level of calculus and trigonometry, and understand the importance of following the data when making design decisions.

Organization and Attention to Detail.  

Curiosity.  

Creativity.  

Critical Thinking.

Intuition.

Explanation:

6 0
2 years ago
What's the monomer? Show the structure.
ivolga24 [154]

In order to understand a monomer let´s first see the structure of a polymer. As an example, in the first figure polyethylene (or polyethene) is shown. This polymer, like every other one, is composed of many repeated subunits, these subunits are called monomer. In the second figure, polyethylene's monomer is shown.  

7 0
3 years ago
What is the value of the work interaction in this process?
Cloud [144]

Answer:

The answer is "-121\  \frac{KJ}{Kg}".

Explanation:

Please find the correct question in the attachment file.

using formula:

\to W=-P_1V_1+P_2V_2 \\\\When \\\\\to W= \frac{P_1V_1-P_2V_2}{n-1}\ \   or \ \  \frac{RT_1 -RT_2}{n-1}\\\\

W =\frac{R(T_1 -T_2)}{n-1}\\\\

    =\frac{0.287(25 -237)}{1.5-1}\\\\=\frac{0.287(-212)}{0.5}\\\\=\frac{-60.844}{0.5}\\\\=-121.688 \frac{KJ}{Kg}\\\\=-121 \frac{KJ}{Kg}\\\\

7 0
3 years ago
Other questions:
  • What is a p-n junction? Show by the diagram.
    6·1 answer
  • A solid titanium alloy [G 114 GPa] shaft that is 720 mm long will be subjected to a pure torque of T 155 N m. Determine the mini
    5·1 answer
  • A three-phase voltage source with a terminal voltage of 22kV is connected to a three-phase transformer rated 5MVA 22kV/220V. The
    8·1 answer
  • The soil borrow material to be used to construct a highway embankment has a mass unit weight of 107.0 lb/cf and a water content
    6·1 answer
  • Gshyevdnmdcicm gngjc
    13·1 answer
  • What the Best describes the purpose of the occupational safety and health administración OSHA
    12·1 answer
  • Use the map to complete the table by selecting the boxes that best describe how ocean currents affect the
    14·1 answer
  • The Hoover Dam is 221 m tall and 379 m wide. Approximating it as a flat plate, determine the effective resultant force on the da
    6·1 answer
  • Air enters a counterflow heat exchanger operating at steady state at 27 C, 0.3 MPa and exits at 12 C. Refrigerant 134a enters at
    5·1 answer
  • Can someone explain the answer for this question please? -metrology
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!