My Program is supposed output recommended calorie Intake if Over or Underweight, works fine if overweight but the calorie intake is way to low for someone underweight.
// Creating Ouput For User to Choose Gender, and Activity Level
{
cout << " " << endl;
cout << " * Body Mass Index * " << endl;
cout << " " << endl;
cout << " (BMI) Less Than 18.5 = Underweight" << endl;
cout << " (BMI) Between (18.5 - 25) = Optimal" << endl;
cout << " (BMI) More Than 25 = Overweight" << endl;
cout << "______________________________________________________________________________ " << endl;
cout << " " << endl;
cout << " { Gender and Level of Current Activity } " << endl;
cout << "" << endl;
cout << "1. Moderately Active Female" << endl;
cout << "2. Relatively Inactive Female" << endl;
cout << "3. Moderately Active Male" << endl;
cout << "4. Relatively Inactive Male" << endl;
cout << "______________________________________________________________________________" << endl;
cout << " " << endl;
// Defining Variables For Users Input - To Create Output And Store Values
string name;
int weight;
double height;
int number;
// Beginning Source Code
cout << " What is your name? ";
getline (cin,name);
cout << " How tall are you? (example 5.4): ";
cin >> height;
height = floor ((height * 12) + .5); //< Rounding Up/Down Using floor With Int Function
cout << " What is your current Weight in pounds? ";
cin >> weight;
// Defining (BMI) Based On User Input
double BMI = (weight * 703) / pow(height, 2);
// Continuing Source Code With Users Input + Choice
cout << " Choose a number <1-4> that repersent your life style: ";
cin >> number;
cout << " " << endl;
switch (number)
{
// Creating Limits For Case # 1
case 1:
cout << " You are a Moderately Active Female " << endl;
cout << setprecision(2) << fixed << " Your Current Body Mass Index is: " << BMI << endl;
if (BMI < 18.5)
{
cout << " Weight Category is Consider: Underweight " << endl;
cout << " Recommeneded Daily Calorie Intake is: " << weight * 12 << endl;
}
else if (BMI >= 18.5 && BMI <= 25)
{
cout << " Weight Category is Consider: Optimal " << endl;
cout << " You Do Not Have A Recommended Daily Calorie Intake " << endl;
}
else if (BMI > 25)
{
cout << " Weight Category is Consider: Overweight " << endl;
cout << " Recommended Daily Calorie Intake Is: " << weight * 12 << endl;
}
break;
// Creating Limits For Case # 2
case 2:
cout << " Your are a Relatively Inactive Female " << endl;
cout << setprecision(2) << fixed << " Your Current Body Mass Index is: " << BMI << endl;
if (BMI < 18.5)
{
cout << " Weight Category is Consider: Underweight " << endl;
cout << " Recommended Daily Calorie Intake Is: " << weight * 10 << endl;
}
else if (BMI >= 18.5 && BMI <= 25)
{
cout << " Weight Category is Consider: Optimal " << endl;
cout << " You Do Not Have A Recommended Daily Calorie Intake " << endl;
}
else if (BMI > 25)
{
cout << " Weight Category is Consider: Overweight " << endl;
cout << " Recommended Daily Calorie Is: " << weight * 10 << endl;
}
break;
// Creating Limits For Case # 3
case 3:
cout << " You are a Moderately Active Male " << endl;
cout << setprecision(2) << fixed << " Your Current Body Mass Index is: " << BMI << endl;
if (BMI < 18.5)
{
cout << " Weight Category is Consider: Underweight " << endl;
cout << " Recommended Daily Calorie Intake Is: " << weight * 15 << endl;
}
else if (BMI >= 18.5 && BMI <= 25)
{
cout << " Weight Category is Consider: Optimal " << endl;
cout << " You Do Not Have A Recommended Daily Calorie Intake " << endl;
}
else if (BMI > 25)
{
cout << " Weight Category is Consider: Overweight " << endl;
cout << " Recommended Daily Calorie Intake Is: " << weight * 15 << endl;
}
break;
// Creating Limits For Case # 4
case 4:
cout << " You are a Relatively Inactive Male " << endl;
cout << setprecision(2) << fixed << " Your Current Body Mass Index is: " << BMI << endl;
if (BMI < 18.5)
{
cout << " Weight Category is Consider: Underweight " << endl;
cout << " Recommended Daily Calorie Intake Is: " << weight * 13 << endl;
}
else if (BMI >= 18.5 && BMI <= 25)
{
cout << " Weight Category is Consider: Optimal " << endl;
cout << " You Do Not Have A Recommended Daily Calorie Intake " << endl;
}
else if (BMI > 25)
{
cout << " Weight Category is Consider: Overweight " << endl;
cout << " Recommended Daily Calorie Intake Is: " << weight * 13 << endl;
}
break;
// Limit For Choice Numbers (1-4) Only
default:
cout << " Invaild Entry Please Try Again" << endl;
Im not seeing what im missing with in the code i was given these formulas for the recommended calorie intake
• Moderately active female: daily calories = weight (in pounds) * 12 calories per pound
• Relatively inactive female: daily calories = weight (in pounds) * 10 calories per pound
• Moderately active male: daily calories = weight (in pounds) * 15 calories per pound
• Relatively inactive male: daily calories = weight (in pounds) * 13 calories per pound