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
The three sub regions of South America are the Andes Mountains, the Amazon Rainforest, and the Eastern Highlands. The Atacama De
Leto [7]

Answer:

<:

Explanation:

8 0
3 years ago
Read 2 more answers
The heat flux through a 1-mm thick layer of skin is 1.05 x 104 W/m2. The temperature at the inside surface is 37°C and the tempe
miss Akunina [59]

Answer:

a) Thermal conductivity of skin: k_{skin}=1.5W/mK

b) Temperature of interface: T_{interface}=35.6\°C

Heat flux through skin: \frac{Q}{A}=2100W/m^2

Explanation:

a)

k=\frac{QL}{A(T_{2}-T_{1})}

Where: k is thermal conductivity of a material, \frac{Q}{A} is heat flux through a material, L is the thickness of the material, T_{1} is the temperature on the first side and T_{2} is the temperature on the second side

k_{skin}=\frac{QL}{A(T_{2}-T_{1})}

k_{skin}=\frac{Q}{A}*\frac{L}{(T_{2}-T_{1})}

k_{skin}=1.05*10^{4}*\frac{1*10^{-3}}{(37-30)}

k_{skin}=1.5W/mK

b)

k_{insulation}=\frac{k_{skin}}{2}

k_{insulation}=\frac{1.5}{2}

k_{insulation}=0.75W/mK

The heat flux between both surfaces is constant, assuming the temperature is maintained at each surface.

\frac{Q}{A}=\frac{k(T_{2}-T_{1})}{L}

\frac{k_{skin}(T_{skin}-T_{interface})}{L_{skin}}=\frac{k_{insulation}(T_{interface}-T_{insulation})}{L_{insulation}}

\frac{1.5*(37-T_{interface})}{0.001}=\frac{0.75*(T_{interface}-30)}{0.002}

55500-1500T_{interface}=375T_{interface}-11250

1875T_{interface}=66750

T_{interface}=35.6\°C

\frac{Q}{A}=\frac{k_{skin}(T_{skin}-T_{interface})}{L_{skin}}

\frac{Q}{A}=\frac{1.5*(37-35.6)}{0.001}

\frac{Q}{A}=2100W/m^2

3 0
3 years ago
Show that y = '(t - s)f(s)ds is a solution to my" + ky = f(t). Use g' (0) = 1/m and mg" + kg = 0. 6.1) Derive y' 6.2) Using g(0)
Gre4nikov [31]

Answer:

Explanation:

Given that:

y = \int^t_og'(t-s) f(s) ds \  \text{is  solution to } \ my"ky= f(t)

where;

g'(0) = \dfrac{1}{m}     and mg"+kg = 0

\text{Using Leibniz Formula to prove the above equation:}

\dfrac{d}{dt} \int ^{b(t)}_{a(t)} \ f (t,s) \ ds = f(t,b(t) ) * \dfrac{d}{dt}b(t) - f(t,a(t)) *\dfrac{d}{dt}a(t) + \int ^{b(t)}_{a(t)}\dfrac{\partial}{\partial t} f(t,s) \ dt

So, y = \int ^t_0  g' (t-s) f(s) \ ds

\text{By differentiation with respect to t;}

y' = g'(o) f(t) \dfrac{d}{dt}t- 0 + \int^{t}_{0}g'' (t-s) f(s) ds \\ \\  y' = \dfrac{1}{m}f(t) + \int ^t_0 g'' (ts) f(s) \ ds

y'' = \dfrac{1}{m} f'(t) + g"(0) f(t) + \int^t_o g"'(t-s) f(s)ds --- (1)

Since \ \ mg" (t) +kg (t) = 0  \\ \\  \implies g" (t) = -\dfrac{k}{m} g(t) --- (111) \\ \\  put \  t \  =0 \  we  \ get;\\g" (0) = - \dfrac{k}{m } g(0)  \\ \\  g"(0) = 0 \ \ \ \   ( because \  g(0) =0) \\ \\

Now \ differentiating \ equation (111) \ with \ respect \ to \ t  \\ \\  g"'(t) = -\dfrac{k}{m}g(t)  \\ \\  replacing  \ it \ into  \ equation \ (1) \\ \\ y" = \dfrac{1}{m}f' (t) + 0 + \int ^t_o  \dfrac{-k}{m}g' (t-s) f(s) \ ds \\ \\ y" = \dfrac{1}{m}f' (t) - \dfrac{k}{m} \int ^t_o g' (t-s) \ f(s) \ ds \\ \\  y" = \dfrac{1}{m}f'(t) - \dfrac{k}{m}y \\ \\  my" = f'(t)-ky \\ \\ \implies \mathbf{ my" +ky = f'(t)}

7 0
3 years ago
What differentiates an athletic trainer from a clinical exercise physiologist?
kozerog [31]

Answer:

It's number 3

Explanation:

3 0
3 years ago
Read 2 more answers
If 1,490 compacted cubic yards of in-place soil is required for a project, how many loads of import will be required? The import
trasher [3.6K]

Answer:

149 loads of import will be required for the project.

Explanation:

bank cubic yards = bcy

Loose cubic yards = lcy

Calculate for the required bank cubic yards.

Required bank cubic yards = required in place cubic yards/shrinkage

Substitute

required in place cubic yards = 1,490 ccy

shrinkage percentage = 95% = 0.95

Required bank cubic yards = 1,490/0.95 = 1,568.42 bcy

Determine the volume of the material to be transported

Loose cubic yards = bank cubic yards * (1 + swell percentage)

swell percentage = 14% = 0.14

Loose cubic yards = 1,568.42*(1+0.14) = 1,788 lcy

loads of import that will be required = Loose cubic yards/truck haul capacity

loads of import that will be required = 1,788/12 = 149 load

3 0
3 years ago
Read 2 more answers
Other questions:
  • Compute the sum with carry-wraparound (sometimes called the one's complement sum) of the following two numbers. Give answer in 8
    15·1 answer
  • A single crystal of a metal that has the BCC crystal structure is oriented such that a tensile stress is applied in the [100] di
    10·1 answer
  • 3. Suppose that a class named Bicycle contains a private nonstatic integer named height, a public nonstatic String named model,
    10·1 answer
  • A horizontal curve on a 4-lane highway (two lanes on each direction with no median) has a superelevation of 6% and a central ang
    5·1 answer
  • 4. A person is standing 4 miles east from his house. He travels 2 miles east. a. Calculate the initial displacement. b. Calculat
    13·1 answer
  • Write a loop that sets each array element to the sum of itself and the next element, except for the last element which stays the
    8·2 answers
  • If the open circuit voltage of a circuit containing ideal sources and resistors is measured at 8 , while the current through the
    14·2 answers
  • The size of an engine is called the engine
    9·2 answers
  • Historical thinking skills can be divded into there main processes
    11·1 answer
  • a ball is subject to two forces F1 and F2. The magnitudes of the two forces are 45.0 N and 70.0 N respectively. In the figure be
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!