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]
2 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]2 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
What are supercapacitors ?
OLEGan [10]

Answer:

A supercapacitor, also called an ultracapacitor, is a high-capacity capacitor with a capacitance value much higher than other capacitors, but with lower voltage limits, that bridges the gap between electrolytic capacitors and rechargeable batteries.

Explanation:

6 0
3 years ago
Read 2 more answers
A remote village on an island was devastated by a typhoon. Farmland was flooded and the crops
insens350 [35]

Answer:

A flood happens when water overflows or soaks land that is normally dry. flooding, happens when a large storm or tsunami causes the sea to They soon fell ill and died from cholera, which is spread by  Rice, wheat, and corn crops were destroyed.  Excess water overflows and runs on top of the land.

Explanation:

hope this helps

6 0
3 years ago
For a steel alloy it has been determined that a carburizing heat treatment of 15 h duration will raise the carbon concentration
Amiraneli [1.4K]

Answer:

135 hour

Explanation:

It is given that a carburizing heat treatment of 15 hour will raise the carbon concentration by 0.35 wt% at a point of 2 mm from the surface.

We have to find the time necessary to achieve the same concentration at a 6 mm position.

we know that \frac{x_1^2}{Dt}=constant where x is distance and t is time .As the temperature is constant so D will be also constant

So \frac{x_1^2}{t}=constant

then \frac{x_1^2}{t_1}=\frac{x_2^2}{t_2} we have given x_1=2 mm\ ,t_1=15 hour\ ,x_2=6\ mm and we have to find t_2 putting all these value in equation

\frac{2^2}{15}=\frac{6^2}{t_2}

so t_2=135\ hour

5 0
3 years ago
You are about to perform PMCS on your M1114? What resource should you use for the procedures and instructions for performing PMC
aniked [119]

The resources and instructions that should be used for the procedures of performing PMCS are:

  1. Operator's manuals
  2. Safety cautions and warnings.
  3. Fording kit
  4. Heating and cooling systems.

<h3>What is PMCS?</h3>

PMCS is an acronym for preventive maintenance checks and services and it can be defined as the maintenance, checks, and services that are typically performed before, during, and after the use of any type of military equipment such as:

  • M1114
  • M1151
  • M1123

Basically, the resources and instructions that should be used for the procedures of performing PMCS are:

  1. Operator's manuals
  2. Safety cautions and warnings.
  3. Fording kit
  4. Heating and cooling systems.

Read more on PMCS here: brainly.com/question/15720250

#SPJ1

4 0
1 year ago
What causes the moon to be illuminated? PLEASE HELP MEH ILL GIVE YOU BRAINLEIST!!
Likurg_2 [28]

Answer:

D Reflection

Explanation:

It reflects the light from the sun. Then when the earth gets in the way, it casts a shadow causing crescent moons.

7 0
2 years ago
Other questions:
  • A tank contains liquid nitrogen at -190℃ is suspended in a vacuum shell by three stainless steel rods 0.80 cm in diameter and 3
    8·1 answer
  • The head difference between the inlet and outlet of a 1km long pipe discharging 0.1 m^3/s of water is 0.53 m. If the diameter is
    11·1 answer
  • A 500-m^3 rigid tank is filled with saturated liquid-vapor mixture of water at 200 kPa. If 20% of the mass is liquid and the 80%
    11·1 answer
  • Air enters a compressor operating at steady state at 176.4 lbf/in.^2, 260°F with a volumetric flow rate of 424 ft^3/min and exit
    10·1 answer
  • 1. A copper block of volume 1 L is heat treated at 500ºC and now cooled in a 200-L oil bath initially at 20◦C. Assuming no heat
    10·1 answer
  • What is the difference between a Datum and a Datum Feature? a) A Datum and Datum Feature are synonymous. b) A Datum is theoretic
    14·1 answer
  • Air enters a 200 mm diameter adiabatic nozzle at 195 deg C, 500 kPa and 100 m/s. It exits at 85 kPa. If the exit diameter is 158
    11·1 answer
  • A 2.0-in-thick slab is 10.0 in wide and 12.0 ft long. Thickness is to be reduced in three steps in a hot rolling operation. Each
    9·1 answer
  • A two-bus power system is interconnected by one transmission line. Bus 1 is a generator bus with specified terminal voltage magn
    6·1 answer
  • Determine the resistance of 100m of copper cable whose cross-sectional area is 1.5mm2​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!