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
An open vat in a food processing plant contains 500 L of water at 20°C and atmospheric pressure. If the water is heated to 80°C,
tester [92]

Answer:

percentage change in volume is 2.60%

water level rise is 4.138 mm

Explanation:

given data

volume of water V = 500 L

temperature T1 = 20°C

temperature T2 = 80°C

vat diameter = 2 m

to find out

percentage change in volume and how much water level rise

solution

we will apply here bulk modulus equation that is ratio of change in pressure   to rate of change of volume to change of pressure

and we know that is also in term of change in density also

so

E = -\frac{dp}{dV/V}  ................1

And -\frac{dV}{V} = \frac{d\rho}{\rho}   ............2

here ρ is density

and we know ρ  for 20°C = 998 kg/m³

and ρ  for 80°C = 972 kg/m³

so from equation 2 put all value

-\frac{dV}{V} = \frac{d\rho}{\rho}

-\frac{dV}{500*10^{-3} } = \frac{972-998}{998}

dV = 0.0130 m³

so now  % change in volume will be

dV % = -\frac{dV}{V}  × 100

dV % = -\frac{0.0130}{500*10^{-3} }  × 100

dV % = 2.60 %

so percentage change in volume is 2.60%

and

initial volume v1 = \frac{\pi }{4} *d^2*l(i)    ................3

final volume v2 = \frac{\pi }{4} *d^2*l(f)    ................4

now from equation 3 and 4 , subtract v1 by v2

v2 - v1 =  \frac{\pi }{4} *d^2*(l(f)-l(i))

dV = \frac{\pi }{4} *d^2*dl

put here all value

0.0130 = \frac{\pi }{4} *2^2*dl

dl = 0.004138 m

so water level rise is 4.138 mm

8 0
3 years ago
HELP PLS
Angelina_Jolie [31]

Answer:

The correct option is;

B) Metamorphic Rocks

Explanation:

Zoisite, which is also referred to saualpite, is a metamorphic rock which is a hydroxy sorosilicate mineral formed from other types of rocks such as sedimentary, metamorphic and ingenious rocks in the process of their metamorphism under the presence high temperatures and pressures and mineral fluids which are hot

Zoiste is named after Sigmund Zois by Abraham Gottlob Werner in 1805 when Sigmund Zois sent Abraham Gottlob Werner the mineral specimen from Saualpe in 1805

6 0
3 years ago
Which of the following is a possible consequence of poor measurement in construction as stated in the segment?
Kamila [148]

Answer:

Decreased risk of structure failure

6 0
3 years ago
Which of the following applies to a module?
Ipatiy [6.2K]

Answer:

D all of the above

Explanation:

because I said so

3 0
2 years ago
What is the 16 diget code to downlod pokemon ultra sun for free on ds
Kazeer [188]

Answer:

2468962218527611

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • In Florida a curb indicates and area where parking is prohibited
    15·2 answers
  • You are considering building a residential wind power system to produce 6,000 kWh of electricity each year. The installed cost o
    15·1 answer
  • Three possible career opportunities in embedded systems engineering
    11·1 answer
  • What is the function of engineering
    6·1 answer
  • How to comment on brainly.com and I'm only 8-years-old so keep it simple please
    9·1 answer
  • B) Calculate the FS against uplift and calculate effoctive stress at the base level for water
    11·1 answer
  • For a small company it's usually best to keep the corporate and brand image as___ as possible​
    9·1 answer
  • How do you breed a linner?
    5·2 answers
  • The forklift exiting an aisle in a warehouse has the right of way?
    15·1 answer
  • What car is this? I thinks its a nissan 240sx but i dont know
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!