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
We would like to measure the density (p) of an ideal gas. We know the ideal gas law provides p= , where P represents pressure, R
Nostrana [21]

Answer: =

Explanation:

=    P / (R * T) P- Pressure, R=287.058, T- temperature

From the given that

Sample mean(pressure) = 120300 Pa

Standard deviation (pressure) = 6600 Pa

Sample mean(temperature) = 340K

Standard deviation(temperature) = 8K

To calculate the Density;

Maximum pressure = Sample mean(pressure) + standard deviation (pressure) = 120300+6600 = 126900 Pa

Minimum pressure = Sample mean (pressure) - standard deviation (pressure)= 120300-6600 = 113700 Pa

Maximum temperature = Sample mean (temperature) + standard deviation (temperature) = 340+8 = 348K

Minimum temperature = Sample mean (temperature) - standerd deviation (temperature) = 340-8 = 332K

So now to calculate the density:

Maximum Density= Pressure (max)/(R*Temperature (min))= 126900/(287.058*332)= 1.331

Minimum density=Pressure(min)/(R*Temperature (max))= 113700/(287.058*348)= 1.138

Average density= (density (max)+ density (min))/2= (1.331+1.138)/2= 1.2345

cheers i hope this helps

5 0
3 years ago
Showing or hiding records in a database is called “filtering.”<br> True<br> False
agasfer [191]

Answer:

TRUE

Explanation:

4 0
2 years ago
Read 2 more answers
Tech A says you can find the typical angle of a V-block engine by dividing the number of cylinders by 720
Lady_Fox [76]

Answer:

Tech A is correct

Explanation:

Tech A is right as its V- angle is identified by splitting the No by 720 °. Of the piston at the edge of the piston.

Tech B is incorrect, as the V-Angle will be 720/10 = 72 for the V-10 motor, and he says 60 °.

8 0
2 years ago
For methyl chloride at 100°C the second and third virial coefficients are: B = −242.5 cm 3 ·mol −1 C = 25,200 cm 6 ·mol −2 Calcu
bogdanovich [222]

Answer:

a)W=12.62 kJ/mol

b)W=12.59 kJ/mol

Explanation:

At T = 100 °C the second and third virial coefficients are

B = -242.5 cm^3 mol^-1

C = 25200 cm^6  mo1^-2

Now according isothermal work of one mole methyl gas is

W=-\int\limits^a_b {P} \, dV

a=v_2\\

b=v_1

from virial equation  

\frac{PV}{RT}=z=1+\frac{B}{V}+\frac{C}{V^2}\\   \\P=RT(1+\frac{B}{V} +\frac{C}{V^2})\frac{1}{V}\\

And  

W=-\int\limits^a_b {RT(1+\frac{B}{V} +\frac{C}{V^2}\frac{1}{V}  } \, dV

a=v_2\\

b=v_1

Now calculate V1 and V2 at given condition

\frac{P1V1}{RT} = 1+\frac{B}{v_1} +\frac{C}{v_1^2}

Substitute given values P_1\\ = 1 x 10^5 , T = 373.15 and given values of coefficients we get  

10^5(v_1)/8.314*373.15=1-242.5/v_1+25200/v_1^2

Solve for V1 by iterative or alternative cubic equation solver we get

v_1=30780 cm^3/mol

Similarly solve for state 2 at P2 = 50 bar we get  

v_1=241.33 cm^3/mol

Now  

W=-\int\limits^a_b {RT(1+\frac{B}{V} +\frac{C}{V^2}\frac{1}{V}  } \, dV

a=241.33

b=30780

After performing integration we get work done on the system is  

W=12.62 kJ/mol

(b) for Z = 1 + B' P +C' P^2 = PV/RT by performing differential we get  

         dV=RT(-1/p^2+0+C')dP

Hence work done on the system is  

W=-\int\limits^a_b {P(RT(-1/p^2+0+C')} \, dP

a=v_2\\

b=v_1

by substituting given limit and P = 1 bar , P2 = 50 bar and T = 373 K we get work  

W=12.59 kJ/mol

The work by differ between a and b because the conversion of constant of virial coefficients are valid only for infinite series  

8 0
3 years ago
The function below takes a single parameter, a list of numbers called number_list. Complete the function to return a string of t
makkiz [27]

Answer:

The solution code is written in Python:

  1. def convertCSV(number_list):
  2.    str_list = []
  3.    for num in number_list:
  4.        str_list.append(str(num))
  5.    
  6.    return ",".join(str_list)
  7. result = convertCSV([22,33,44])
  8. print(result)

Explanation:

Firstly, create a function "convertCSV" with one parameter "number_list". (Line 1)

Next, create an empty list and assign it to a new variable <em>str_list</em>. (Line 2)

Use for-loop to iterate through all the number in the <em>number_list</em>.(Line 4). Within the loop, each number is converted to a string using the Python built-in function <em>str() </em>and then use the list append method to add the string version of the number to <em>str_list</em>.

Use Python string<em> join() </em>method to join all the elements in the str_list as a single string. The "," is used as a separator between the elements (Line 7) . At the end return the string as an output.

We can test the function by calling the function and passing [22,33,34] as an argument and we shall see "22,33,44" is printed as an output. (Line 9 - 10)

6 0
3 years ago
Other questions:
  • What is the difference between absolute and gage pressure?
    11·1 answer
  • Members of the student council have been asked by their
    5·1 answer
  • Air enters the compressor of an ideal cold air-standard Brayton cycle at 100 kPa, 300 K, with a mass flow rate of 6 kg/s. The co
    11·1 answer
  • A metallic material with yield stress of 140 MPa and cross section of 300 mm x 100 mm, is subjected to a tensile force of 8.00 M
    12·1 answer
  • What is the linear distance traveled in one revolution of a 36-inch wheel
    6·1 answer
  • Suppose you have a Y-connected balanced three-phase load which consumes 200 kW with pf of 0.707 lagging. The line-to-line voltag
    14·1 answer
  • During a long run a very well-trained dog can use up to 1000 ‘cal’/hour (Note: Food calories differ by a factor of one thousand
    14·1 answer
  • (Signal Property) Under what condition is a discrete-time signal x[????] or a continuous-time signal x(????) periodic? Determine
    5·1 answer
  • What is the difference between a series circuit and a parallel circuit?
    11·2 answers
  • A 46.0-g meter stick is balanced at its midpoint (50.0 cm, zero point is a left end of stick). Then a 210.0-g weight is hung wit
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!