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
What is one of the differences between Random Access Memory (RAM) and Read Only Memory (ROM)? RAM is where files are stored, and
Dmitry [639]

Answer:

Characteristics of RAM or ROM memory

Explanation:

RAM (Random Access Memory).  

• It is a read (R) and write (W) memory (R/W)

• Types of RAM - SDR SDRAM, RDRAM, DDR SDRAM. The difference is the speed in sending data.

• It is used for the operating system, programs and most of the software.

• Recommendations of at least 8 GB of RAM for PC and   At least 2 GB of RAM for a mobile.

ROM (Read Only Memory)

• Store instructions and data permanently

• it's read only

•  Type of non-volatile memory

• Save data and system information, settings and programs

• Types of ROM - Mask ROM, PROM, EPROM and EEPROM.

  • A PC must have at least 256 GB.

4 0
3 years ago
Read 2 more answers
A plan budget time for studying and activities is referred to as?
Lady_Fox [76]

Answer:

sorry u got scamed

Explanation:

4 0
3 years ago
Mark is flying to Atlanta. The flight is completely full with 200 passengers. Mark notices he dropped his ticket while grabbing
Greeley [361]

Answer:

The list that would be helpful in this situation would be a list of people in the airport

Hope This Helps!!!

8 0
3 years ago
A _____ cloud allows an organization to take advantage of the scalability and cost-effectiveness that a public cloud computing e
balu736 [363]

Answer:

Hybrid

Explanation:

Hybrid cloud is a solution that combines a private cloud with one or more public cloud services, with proprietary software enabling communication between each distinct service.

5 0
3 years ago
An object reference provides a(an)______for an object and is used to gain access to the object (Points : 2) entry
sdas [7]

Answer: Instance

Explanation: Instance is the term found in the object-orient programming concept. It is used for the realization of the variation present in any object specifically.The program execution at each time instant is known as the instance of program. Generation of realized instance is known as instantiation.

This helps in the accessing of the object in the program.Other options are incorrect entry , target and handle are not the technical term related with the accessing of object .Thus the correct answer is instance.

3 0
3 years ago
Other questions:
  • With a(n) ____ data table you can vary the value in one cell.
    5·1 answer
  • Write the following function without using the C++ string class or any functions in the standard library, including strlen(). Yo
    12·1 answer
  • Text can be easily moved from one location to another using _____.
    15·1 answer
  • A ________ is a powerful analytical tool to size up Apple Inc.'s competitive assets in order to determine whether or not those a
    9·1 answer
  • An IT professional with a customer-service
    13·1 answer
  • True or false: The objective of an Enterprise Resource Planning (ERP) system is to create a customized software program that int
    10·1 answer
  • Why are Quick Parts useful in an Outlook message?
    5·1 answer
  • In the table below, identify the data type that would be most suitable for the second field.
    10·2 answers
  • These 2 questions PLEASEEE (:
    14·1 answer
  • Write a program that removes all non-alphabetic characters from the given input.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!