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
Which code snippet could be used to print the following series?
GaryK [48]
C is the answer, I think
7 0
1 year ago
I don't know what to do, anyone there?​
s2008m [1.1K]
I’m here, hello. . . . . . .
3 0
2 years ago
Which two men developed the steam engine?
Whitepunk [10]

Answer:

Thomas Savery and Edward Somerset.

Explanation:

6 0
3 years ago
Linux is not secure as it is difficult to detect bugs and fix<br> true or false plz reply
Mazyrski [523]

False.

Linux is the most secure operating system

8 0
3 years ago
In 2-3 sentences, explain to another student why shortcuts are beneficial. Include details about shortcuts that you have used.
Kipish [7]

Answer:

Explanation:

Keyboard Shortcut Examples

crtl + esc = open start menu

alt + tab = switch apps

ctrl + z = undo

Shortcuts basically help everything occur in a quicker form . They help make the task easier .

3 0
2 years ago
Read 2 more answers
Other questions:
  • Marie uses a browser to visit a blog. What is the unique identifier of the blog? A. web page B. website C. web address D. email
    7·2 answers
  • The trademarked name of the accepted standard for configuring wireless networks is _______________
    12·1 answer
  • Bunch of points!!!!!!! help pls
    11·2 answers
  • The dlci field in the frame relay header is _________ bits long.
    14·1 answer
  • Which type of software is the most similar to database software?\
    5·1 answer
  • The methods in a subclass can use all of the data fields and methods that belong to its parent, with one exception: ____ members
    11·1 answer
  • -(-13) P binary using signed. 2's complement representation
    11·1 answer
  • Wht is these things Aᔑ bʖ cᓵ d↸ eᒷ f⎓ g⊣ h⍑ i╎
    15·2 answers
  • A computer on a network that is not the server​
    15·1 answer
  • How does a cell phone change the<br> incoming signals from a caller into sound that<br> you can hear
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!