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
Advances in vehicle manufacturing technology have decreased the need for:
Llana [10]

Answer:

D large amounts of labor

Explanation:

7 0
3 years ago
(i) what assumptions about the relationship between the inputs and output are inherent in this specification? do scatter plots s
olasank [31]

A problem that will be handled by a procedure is described by an input-output specification.

<h3>What is input and output specification?</h3>
  • An input-output specification outlines the issue that a procedure will try to solve. The input part and the output part are its two components.
  • The input component outlines the kind of data object that should be provided for each actual argument as well as any presumptions that the process might make.
  • A technical specification known as an output specification defines the project scope primarily through performance-based requirements.
  • It is used to assess technical compliance and serves as the technical cornerstone of both the procurement and delivery phases.
  • Known as classical specifications, they outline the precise services to be provided, sometimes in great detail, along with the standard you must meet and the approach you must take to meet the standard.

To Learn more About input-output specification Refer To:

brainly.com/question/25265909

#SPJ4

5 0
1 year ago
Need help please????????!!!!!!
Alekssandra [29.7K]

Answer A the more traing the more you will know

Explanation:

4 0
3 years ago
What is the magnetic force on a moving electric charge called
crimeas [40]
The magnetic force on a free moving charge is perpendicular to both the velocity of the charge and the magnetic field with direction given by the right hand rule. The force is given by the charge times the vector product of velocity and magnetic field.
4 0
3 years ago
Read 2 more answers
In a short essay, discuss the question, "How are you an innovator?"
iragen [17]

Answer:

Being innovative means doing things differently or doing things that have never been done before. An innovator is someone who has embraced this idea and creates environments in which employees are given the tools and resources to challenge the status quo, push boundaries and achieve growth.

Explanation:

Hope it helps..

But it's a little bit long..

Correct me if I'm wrong..

7 0
3 years ago
Other questions:
  • What will happen in a wire drawing operation when the cross-sectional area has a reduction of 60% in a single pass?
    10·1 answer
  • A truck is hauling a 300-kg log out of a ditch using a winch attached to the back of the truck. Knowing the winch applies a cons
    14·1 answer
  • For the reactions of ketone body metabolism, _______.
    15·1 answer
  • QUESTIONS
    12·1 answer
  • Under EPA's regulations, which of the following methods can be used to pressurize an R11 or R123 system for the purpose of openi
    11·1 answer
  • In an apartment the interior air temperature is 20°C and exterior air temperatures is 5°C. The wall has inner and outer surface
    8·1 answer
  • A 3-m wide rectangular channel has a flow velocity of 1.8 m/s when the depth of flow is 1.2 m. what will be the flow velocity wh
    14·1 answer
  • Which type of engineer often works with radar, communication, and navigation systems? electrical engineer chemical engineer indu
    7·1 answer
  • A tiger cub has a pattern of stripes on it for that is similar to that of his parents where are the instructions stored that pro
    8·1 answer
  • What happens to the electrolyte, during discharging?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!