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 many GT2RS cars were made in 2019
labwork [276]

Answer:

1000

Explanation:

3 0
3 years ago
Read 2 more answers
Why do we need an architect?explain briefly by focusing on its various sectors.
lara [203]

Answer:

An architect will help you determine exactly what you need and come up with inventive ideas to solve even the most complex design problems. Think of us as professional 3D problem solvers! An architect can and should lift your project out of the ordinary.

Explanation:

What are the 3 main functions of an architect?

Design: Architects must design, plan, and develop concepts to create construction plans and technical documents. These are based on client requirements and ideas. Research: Architects must learn about the different building codes, safety regulations, construction innovations and city laws that affect their designs

What are the 7 types of architecture?

There are several main types of architects who focus on different types of structures and designs.

...

Commercial Architects

Office buildings / skyscrapers.

Hotels.

Bridges.

Schools.

Museums.

Government buildings.

Multi-unit residential buildings.

Pretty much any type of building that's not a residential home.

8 0
2 years ago
What is your name in face book​
nekit [7.7K]

Answer:

Why do you want to know...?

4 0
3 years ago
Read 2 more answers
Which system of linear inequalities is represented by the graph? y &gt; x – 2 and y x + 1 y x + 1 y &gt; x – 2 and y &lt; x + 1
KatRina [158]

Answer:

The graph representing the linear inequalities is attached below.

Explanation:

The inequalities given are :

y>x-2   and y<x+1

For tables for values of x and y and get coordinates to plot for both equation.

In the first equation;

y>x-2

y=x-2

y-x = -2

The table will be :

x    y

-2  -4

-1    -3

0     -2

1      -1

2      0

The coordinates to plot are : (-2,-4) , (-1,-3), (0,-2), (1,-1) ,(2,0)

Use a dotted line and shade the part right hand side of the line.

Do the same for the second inequality equation and plot then shade the part satisfying the inequality.

The graph attached shows results.

5 0
4 years ago
Read 2 more answers
Question 2/5
adelina 88 [10]
All of the above. Answer.
7 0
3 years ago
Other questions:
  • When designing a car that runs on wind or Air car . can you tell me the details for the following points Compressed Air Engine:
    8·1 answer
  • What is the maximum number of 12-2 with ground nonmetallic-sheathed cables permitted in an 18-cubic-inch device box if two singl
    11·2 answers
  • Please answer the following questions.
    9·2 answers
  • The dam cross section is an equilateral triangle, with a side length, L, of 50 m. Its width into the paper, b, is 100 m. The dam
    9·1 answer
  • A hollow, spherical shell with mass 2.00kg rolls without slipping down a slope angled at 38.0?.
    15·1 answer
  • is sampled at a rate of to produce the sampled vector and then quantized. Assume, as usual, the minimum voltage of the dynamic r
    9·1 answer
  • 6-What is the difference between the critical point and the triple point?
    15·2 answers
  • An automobile having a mass of 1100 kg initially moves along a level highway at 110 km/h relative to the highway. It then climbs
    7·1 answer
  • Which step in the engineering design phase is requiring concussion prevention from blows up to 40 mph an example of?
    6·1 answer
  • 3. What is special about beryllium-copper alloy tools?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!