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
saw5 [17]
3 years ago
10

Repeat Programming Project 5 but in addition ask the user if he or she is a. Sedentary b. Somewhat active (exercise occasionally

) c. Active (exercise 3–4 days per week) d. Highly active (exercise every day) If the user answers "Sedentary," then increase the calculated BMR by 20 percent. If the user answers "Somewhat active," then increase the calculated BMR by 30 percent. If the user answers "Active," then increase the calculated BMR by 40 percent. Finally, if the user answers "Highly active," then increase the calculated BMR by 50 percent. Output the number of chocolate bars based on the new BMR value.
Computers and Technology
1 answer:
Irina18 [472]3 years ago
5 0

Answer:

Explanation:

//C++ program to calculate the number of chocolate bars to consume in order to maintain one's weight.

#include <iostream>

#include <math.h>

using namespace std;

int main() {

           float weight,height;

           int age,choice;

           char gender;

           float bmr;

           // inputs

           cout<<"\n Enter weight(in pounds) : ";

           cin>>weight;

           cout<<"\n Enter height(in inches) : ";

           cin>>height;

           cout<<"\n Enter age(in years) : ";

           cin>>age;

           cout<<"\n Enter gender(M for male , F for female) : ";

           cin>>gender;

           cout<<"\n Are you :\n 1. Sedentary \n 2. Somewhat active(exercise occasionally)\n 3. Active(exercise 3-4 days per week)\n 4. Highly active(exercise everyday)? ";

           cout<<"\n Choice(1-4) ";

           cin>>choice;

           //calculate bmr based on the gender

           if(gender == 'm' || gender == 'M')

           {

                       bmr = 66+(6.3*weight)+(12.9*height)-(6.8*age);

           }else if(gender == 'f' || gender == 'F')

           {

                       bmr = 655+(4.3*weight)+(4.7*height)-(4.7*age);

           }

           // update bmr based on how active the user is

           if(choice ==1)

                       bmr = bmr + (20*bmr)/100;

           else if(choice == 2)

                       bmr = bmr + (30*bmr)/100;

           else if(choice ==3)

                       bmr = bmr + (40*bmr)/100;

           else if(choice ==4)

                       bmr = bmr + (50*bmr)/100;

           // output

           cout<<"\n The number of chocolate bar that should be consumed = "<<ceil(bmr/230);

           return 0;

}

//end of program

You might be interested in
Susan is a network monitoring technician working on a firewall for her company’s network. In the process to determine an open po
Mekhanik [1.2K]

Answer:

type C:\>nmap 203.0.113.100 and Enter

Explanation:

6 0
2 years ago
PLZZZ HELP MEE i need it done today
Marianna [84]

Answer:

1. B

2. C

Explanation:

7 0
3 years ago
Alexis plans to stop trading once she lose 5% of her account balance, her account balance is $215.00. How much money is she will
irina1246 [14]

Answer:

She's willing to lose $10.75.

Explanation:

$215.00 * .05 = answer

         or

$215.00 * .95 = x

$215.00 - x = answer

7 0
2 years ago
Example of Bandwidth Analogies: using Pipe
skelet666 [1.2K]

Answer:

Bandwidth describes the maximum data transfer rate of a network or Internet connection. ... For example, a gigabit Ethernet connection has a bandwidth of 1,000 Mbps (125 megabytes per second). An Internet connection via cable modem may provide 25 Mbps of bandwidth.

7 0
2 years ago
Read 2 more answers
________ can contain stacked images, text, and other elements which collectively comprise a Photoshop file.
emmasim [6.3K]
If you don’t mind can u add the picture it helps me Answer the question better
6 0
2 years ago
Other questions:
  • Camera shock might happen if you do which of the following to your camera?
    6·2 answers
  • When you access the programs and documents on a computer by what way of icons is said to be employing
    6·1 answer
  • An application needs to calculate sales tax for purchases. You decide to simplify the code by putting the sales tax calculation
    9·1 answer
  • To open the dialog box for modifying styles, which step must you first complete in the Navigation pane?
    11·2 answers
  • #include #include int main( ) { int value = 10; int pid; value += 5; pid = fork( ); if (pid &gt; 0 ) { value += 20; } printf(val
    10·1 answer
  • Lab 6B: printing a binary number
    13·1 answer
  • Moving your Sprite from right to left is considered the X coordinate?
    5·1 answer
  • Read the attached paper titled A Survey of Coarse-Grained Reconfigurable Architecture and comment on it. Make sure to specifical
    5·1 answer
  • C#
    10·1 answer
  • What are three ways of verifying legitimate right of access to a computer system?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!