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
19. A circuit contains four 100 S2 resistors connected in series. If you test the circuit with a digital VOM,
yanalaym [24]

Answer:

D

Explanation:

in series circuit the resistance is divided Total resistance is equal to the sum of resistances

6 0
2 years ago
In the combination of resistors above, consider the 1.50 µΩ and 0.75 µΩ. How can you classify the connection between these two r
Airida [17]

Answer: they are connected in series.

Explanation:

3 0
3 years ago
In highways the far left lane is usually the _____
Ivan
Fastest


(Known as the fast lane)
8 0
3 years ago
Read 2 more answers
Air is contained in a vertical piston–cylinder assembly such that the piston is in static equilibrium. The atmosphere exerts a p
oee [108]

Answer:

a) 24 kg

b) 32 kg

Explanation:

The gauge pressure is of the gas is equal to the weight of the piston divided by its area:

p = P / A

p = m * g / (π/4 * d^2)

Rearranging

p * (π/4 * d^2) = m * g

m = p * (π/4 * d^2) / g

m = 1200 * (π/4 * 0.5^2) / 9.81 = 24 kg

After the weight is added the gauge pressure is 2.8kPa

The mass of piston plus addded weight is

m2 = 2800 * (π/4 * 0.5^2) / 9.81 = 56 kg

56 - 24 = 32 kg

The mass of the added weight is 32 kg.

5 0
2 years ago
A water-filled manometer is used to measure the pressure in an air-filled tank. One leg of the manometer is open to atmosphere.
ddd [48]

Answer:

P = 150.335\,kPa (Option B)

Explanation:

The absolute pressure of the air-filled tank is:

P = 101.3\,kPa + \left(1000\,\frac{kg}{m^{3}} \right)\cdot \left(9.807\,\frac{kg}{m^{3}} \right)\cdot (5\,m)\cdot \left(\frac{1\,kPa}{1000\,Pa} \right)

P = 150.335\,kPa

4 0
3 years ago
Other questions:
  • a. A crude oil pipe’s radius is reduced by 5%. What is the corresponding percentage change in the pressure drop per unit length?
    8·1 answer
  • Fatigue failure occurs under the condition of (a) High elastic stress (b) High corrosivity (c) High stress fluctuations (d) High
    9·1 answer
  • Define volume flow rate Q of air flowing in a duct of area A with average velocity V
    12·1 answer
  • Matthew wants to manufacture a large quantity of products with standardized products having less variety. Which type of producti
    5·1 answer
  • A composite wall is made of two layers of 0.3 m and 0.15 m thickness with surfaces held at 600°C and 20°C respectively. If the c
    9·1 answer
  • Write a function named is_float(s) that takes one argument that is a string. It returns True if string s represents a floating p
    6·1 answer
  • -0-1"<br> -0<br> -20<br> -15<br> -10<br> 0<br> -5
    9·1 answer
  • Q#3:(A)Supose we extend the circular flow mode to add imports and export copy the circular flow digram onto a sheet paper and th
    15·1 answer
  • What are the partial products of 2.3 x 2.6
    15·1 answer
  • A 20cm-long rod with a diameter of 0.250 cm is loaded with a 5000 N weight. If the diameter of the bar is 0.490 at this load, de
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!