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]
4 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]4 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
Write six causes of data lost
just olya [345]
<span>1. Deleting files accidentally
</span>

2. Viruses and damaging malware

3. Mechanical damages of hard drive

4. Power failures

5. Theft of computer

6. Spilling coffee, and other water damages

7. Fire accidents and explosions

<span>Hope this helps.</span>
3 0
4 years ago
PLEASE HELP I HAVE BEEN STUCK ON THIS QUESTION FOR 5m NOW
Nataly_w [17]

Answer:

They are personal, formal and informal.

Explanation:

Hope this helps!

3 0
3 years ago
Read 2 more answers
You work as the IT Administrator for a small corporate network you need to configure configure the laptop computer in the Lobby
Alika [10]

Answer:

okay if I am it administration I will port 10000

8 0
3 years ago
Whats 12/29 divided by 12/34
Mnenie [13.5K]

Answer:34/29 or 1.172413793

8 0
3 years ago
Read 2 more answers
Our bank needs a tool that will help us in determining credit worthiness of loan applicants. We will enter the following informa
lozanna [386]

Answer:

income = float(input("Monthly Income: "))

debt = float(input("Total Debt: "))

minPay = float(input("Monthly minimum payments for the debt: "))

credit = 0

if debt > (income * 6):

   print("No loan can be granted!")

else:

   credit = (income - minPay) * 0.3

   print("You can be approved for upto $" + str(credit))

Explanation:

*The code is in Python

Ask the user for income, debt, and minPay

Check if the debt is greater than income * 6. If it is, print that no loan can be given. Otherwise, Calculate the credit amount using the given formula and print it

8 0
3 years ago
Other questions:
  • How do i add a blog to my wordpress site?
    7·1 answer
  • Using C++.
    7·1 answer
  • Parallel tangent and coincident are examples of what
    13·1 answer
  • Write a program that computes the sum of the first tenpositive integers, 1 + 2 + ..+ 10.
    12·1 answer
  • What things have small motors
    13·1 answer
  • What is the value of i printed? j = i = 1 i += j + j * 5 print("What is i?", i)
    11·1 answer
  • What is the grooming process as it relates to online predators?
    12·2 answers
  • Documentation for evidence which includes exactly what, when, and from whom evidence was collected, the condition of this eviden
    6·1 answer
  • Which scientific tool would be primarily used by scientists?
    12·2 answers
  • For developing a mis in your business organization, you intend to launch a new is department or team. how the is function will s
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!