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
How is a disc brake system different from a drum brake system? Short answer
ddd [48]

Answer:

Disc brake system use a slim rotor and small caliper to halt wheel movement but a drum brake system allow heat to build up inside the drum during heavy braking .

6 0
2 years ago
Read 2 more answers
If there are 16 signal combinations (states) and a baud rate (number of signals/second) of 8000/second, how many bps could I sen
Mice21 [21]

Answer:

32000 bits/seconds

Explanation:

Given that :

there are 16  signal combinations (states) = 2⁴

bits  n = 4

and a baud rate (number of signals/second) = 8000/second

Therefore; the number of bits per seconds can be calculated as follows:

Number of bits per seconds = bits  n × number of signal per seconds

Number of bits per seconds =  4 × 8000/second

Number of bits per seconds = 32000 bits/seconds

6 0
3 years ago
Suppose there are n chairs in a row. We want to compute the number of ways to put 2 students into seats so that they are not nex
icang [17]

Complete Question

The complete question is shown on the first uploaded image

Answer:

a) f_{(n)} = f_{(n-1)} + n-2

b) g_{(n)} = g_(n+1) + (n-2)

Explanation:

The explanation is shown on the second and third uploaded image

8 0
3 years ago
How do you put air knight in slingshock mode.
Nesterboy [21]

Answer:

I am not sure I am understanding plz more context

Explanation:

3 0
3 years ago
To increase the thermal efficiency of a reversible power cycle operating between thermal reservoirs at TH and Tc, would you incr
alukav5142 [94]

<u></u>\ T_{c} has greater effect.

<u>Explanation</u>:

\eta_{\max }=1-\frac{T_{c}}{T_{A}}

T_{c}\\ = Temperature of cold reservoir

T_{H} = Temperature of hot reservoir

when T_{c} is decreased by 't',

$\eta_{\text {incre }}$ = 1-\frac{\left(\tau_{c}-t\right)}{T_{H}}

=n \ + \frac{t}{T_{n}}      -(i)

when {T_{H}} is increased by 'T'

\eta_{i n c}=\frac{n+\frac{t}{T_{H}}}{\left(1+\frac{k}{T_{H}}\right)}-(ii)

\eta_{\text {incre }} \ T_{c}>\eta_{\text {incre }} T_{\text {H }}

7 0
3 years ago
Other questions:
  • 4.
    6·2 answers
  • How do batteries and other types of power sources make physical computing systems more mobile?
    15·2 answers
  • Transcription machinery assembles at _______________.
    6·1 answer
  • Which element of Miranda's character is best illustrated by this excerpt?
    15·1 answer
  • An MRI technician moves his hand from a region of very low magnetic field strength into an MRI scanner’s 2.00 T field with his f
    5·1 answer
  • Engine blocks are made by using a manufacturing process called​
    12·1 answer
  • Draw the six principal views of
    13·1 answer
  • 3. Determine the most unfavorable arrangement of the crane loads and
    6·1 answer
  • Plz help If an item is $13.00 for a case of 24, then it is $
    11·2 answers
  • A technician needs to check the heating operation of a heat pump that has no gauge access ports. The technician should start by:
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!