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
Consider film condensation on a vertical plate. Will the heat flux be higher at the top or at the bottom of the plate? Why?
STALIN [3.7K]

Answer:

During film condensation on a vertical plate, heat flux at the top will be higher since the thickness of the film at the top, and thus its thermal resistance, is lower.

Explanation:

https://www.docsity.com/pt/cengel-solution-heat-and-mass-transfer-2th-ed-heat-chap10-034/4868218/

https://arc.aiaa.org/doi/pdf/10.2514/1.43136

https://arxiv.org/ftp/arxiv/papers/1402/1402.5018.pdf

8 0
3 years ago
Two soils are fully saturated with liquid (no gas present) and the soils have the same void ratio. One soil is saturated with wa
mariarad [96]

Answer:

water sample have more water content

Explanation:

given data

soil 1 is saturated with  water

unit weight of water = 1 g/cm³

soil 2 is saturated with alcohol

unit weight of alcohol  = 0.8 g/cm³

solution

we get here water content that is express as

water content = S_s \times \gamma _w   ....................1

here soil is full saturated so S_s is 100% in both case

so put here value for water

water content = 100 % ×  1

water content = 1 g

and

now we get for alcohol that is

water content  = 100 % × 0.8

water content  = 0.8 g

so here water sample have more water content

5 0
4 years ago
What does product integration refer to in an advanced manufacturing setting?
creativ13 [48]

Answer:

C!!

Explanation:

Combining all manufacturing processes to provide higher efficiency and fulfilling the requeriments.

6 0
4 years ago
Read 2 more answers
A beam spans 40 feet and carries a uniformly distributed dead load equal to 2.2 klf (not including beam self-weight) and a live
salantis [7]

Answer:

A beam is a structural member that is subjected primarily to transverse loads ... stress equal to σy, then the section Moment - Curvature (M-φ) response for .... Example 2.2 Design a simply supported beam subjected to uniformly distributed dead ... (live load). • Step I. Calculate the factored design loads (without self-weight).

Explanation:

6 0
3 years ago
Why metals are good thermal conductors, but polymers are not?
jok3333 [9.3K]

Answer: Metals are good thermal conductors because they have close packaged metal ions in their lattice structure but in polymers they have discontinuous structure which make them poor as a conductor.

Explanation: Metals are considered as good thermal conductors because of their lattice structure which has tightly packed ions in it. In the outer shell of atoms the electrons are free to move and thus conduct the electricity but for the polymers, they have a different structure as compared to metals thus it makes it difficult for a polymer to conduct electricity due to high number of discontinuous particle chains. Therefore metals are good conductors , but polymers are not.

4 0
4 years ago
Other questions:
  • GG(ss) = 1 ss2 + 3 We want to design a feedback control system in a unity feedback structure by adding a controller DD(ss) = ss+
    9·1 answer
  • Consider a fully-clamped circular diaphragm poly-Si with a radius of 250 μm and a thickness of 4 μm. Assume that Young’s modulus
    14·1 answer
  • A car starts at rest and moves along a perfectly straight highway with an acceleration of α1 = 10 m/s2 for a certain amount of t
    15·1 answer
  • A chemistry student accidentally drops a large mercury thermometer and it breaks. The thermometer contained 2 grams of mercury (
    13·1 answer
  • Write a class declaration named Circle with a private member variable named radius. Write set and get functions to access the ra
    8·1 answer
  • Calculate the convective heat-transfer coefficient for water flowing in a round pipe with an inner diameter of 3.0 cm. The water
    8·1 answer
  • Which of the following is not a step in a building’s life cycle?
    6·1 answer
  • What is the answer???
    10·1 answer
  • Q4. The gross command area of canal is
    6·1 answer
  • A common boundary-crossing problem for engineers is when their home country' values come into sharp contrast with the host count
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!