Question: #include using namespace std; int main ( ) { / / input: const double WEIGHT _ CONSTANT = 1 0 . 0 ; const double

#include
using namespace std;
int main(){
// input:
const double WEIGHT_CONSTANT=10.0;
const double HEIGHT_CONSTANT=6.25;
const double AGE_CONSTANT=5.0;
double w,h,a; // weight, height, age
char g; // gender
// output:
double bmr; // body mass ratio
// enter information from user
cout <<"
Enter your gender(M/F): ";
cin >> g;
cout<<"
Enter your age : ";
cin >> a;
cout<<"
Enter your weight : ";
cin >> w; // weight in pounds = weight
cout<<"
Enter your height : ";
cin >> h; //height in feet
// calculation of BMR
if(g=='M')// if gender is male
{
bmr =(10* w/2.2)+(6.25*h*2.54*12)-(5*a)+5;
}
else // if gender is female
{
bmr =(10* w/2.2)+(6.25*h*2.54*12)-(5*a)-161;
}
std::cout <<"fixed;
Your BMR is: "<< bmr;
return 0;
}
I need this code to round up to the nearest whole number for the BMR Output. How do I do this?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!