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.

Answers

Answer 1
Answer:

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


Related Questions

What is this car first to awnser is the brianliest
On a roulette wheel, the pockets are numbered from 0 to 36. The colors of the pockets are as follows: Pocket 0 is green. For pockets 1 through 10, the odd-numbered pockets are red and the even-numbered pockets are black. For pockets 11 through 18, the odd-numbered pockets are black and the even-numbered pockets are red. For pockets 19 through 28, the odd-numbered pockets are red and the even-numbered pockets are black. For pockets 29 through 36, the odd-numbered pockets are black and the even-numbered pockets are red. Write a program that asks the user to enter a pocket number and displays whether the pocket is green, red, or black. The program should display an error message if the user enters a number that is outside the range of 0 through 36.
In which situation does a linear search always perform better than a binary search?
A proper divisor of a positive integer $n$ is a positive integer $d < n$ such that $d$ divides $n$ evenly, or alternatively if $n$ is a multiple of $d$. For example, the proper divisors of 12 are 1, 2, 3, 4, and 6, but not 12. A positive integer $n$ is called double-perfect if the sum of its proper divisors equals $2n$. For example, 120 is double-perfect (and in fact is the smallest double-perfect number) because its proper divisors are 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 24, 30, 40, and 60, and their sum is 240, which is twice 120. There is only one other 3-digit double-perfect number. Write a Python program to find it, and enter the number as your answer below.
The italic button is located on the

What is computer virus?

Answers

It is a (software) program that is installed on a computer without the user's knowledge for the purpose of making harmful changes. A computer virus attaches itself to another program (the execution of the host program triggers the action of the virus). And most of them perform actions that are malicious in nature, such as destroying data. A computer virus operates in two ways: As soon as it lands on a new computer, begins to replicate or it plays dead until the trigger kick starts the malicious code. The term 'computer virus' was formally defined by Fred Cohen in 1983.

Answer:

A computer virus is a virus attached onto your computer, and it gives you bugs and can often delete your important files.

An attempt to generate a large number of session IDs and have a server process them as part of a session hijack attempt is known as what type of attack

Answers

Answer:

An attempt to generate a large number of session IDs and have a server process them as part of a session hijack attempt is known as

TCP Session Hijacking.

Explanation:

TCP Session Hijacking is a cyber-attack in which illegitimate access is acquired to a client's server in the network.  The attacker then hijacks the TCP/IP session by reading and modifying transmitted data packets and also sending requests to the addressee's server.  To achieve this attack effectively, the hacker generates a large number of session IDs, thereby confusing the client's server to process them as a part of the users' sessions. Sessions (a series of interactions between two communication end points) are used by applications to store user parameters and, they remain alive until the user logs off.

. One of the vulnerabilities the Morris worm used was a networking service called finger. The purpose of the finger service is to:A.
report which device drivers a computer uses

B.
determine which ports are open on a computer

C.
report the status of individual computer users

D.
determine which operating system is running on a computer

Answers

Answer: C)report the status of individual computer users

Explanation:Morris worm is known as the program that replicates itself automatically and hides in the computer system.Because of the vulnerability of the system ,the worm worked as finger protocol for the gaining of the user information and status.

Other option are incorrect as the they are not the vulnerability factor for the Morris worm to work on it and thus finger protocols don't work on those option.Thus, the correct answer is option(c)

Suppose the author of an online banking software system has programmed in a secret feature so that the program emails him the account information for any account whose balance has just gone over $10,000. What term best describes this approach to computer crime and what are some of its harm?

Answers

Answer and Explanation:

This type of attack is caused by Trojan Horse.

Most of the times, Trojan is veiled as genuine programming which for this situation is an internet banking framework and can empower the spying by the cyber criminals, theft and gain to remote access to your framework and data. These activities can include:  

  • Erasing information  or data
  • Key logging  
  • Information Corruption /Corruption of data
  • Duplicating data
  • Blocking information  

Among other hurtful activities none of which look good with the beneficiary PC.

1. (1 point) Which flag is set when the result of an unsigned arithmetic operation is too large to fit into the destination? 2. (1 point) Which flag is set when the result of a signed arithmetic operation is either too large or too small to fit into the destination? 3. (1 point) Which flag is set when an arithmetic or logical operation generates a negative result?

Answers

Answer:

(1) Carry flag (2) Overflow flag (3) Sign or negative Flag

Explanation:

Solution

(1) The carry flag : It refers to the adding or subtracting. a two registers has a borrow or carry bit

(2) The over flow flag: This flag specify that a sign bit has been modified during subtracting or adding of operations

(3) The sign flag: This is also called a negative sign flag is a single bit status in a register that specify whether the last mathematical operations  generated a value to know if the most significant bit was set.

What type of malicious software masquerades as legitimate software to entice the user to run it?

Answers

Answer:

Trojan horse

Explanation:

A Trojan horse is malicious software that masquerades as a legitimate computer program such as a video game, image file, utility program, or even an antivirus so as to entice the user to run it, thereby allowing an attackers (the developer of the malicious program) to gain access to the data on the computer in an illegal manner.