Question: /////////////////////////////////////////////////////////////////////////////////// //This program // 1. asks the user her/his weight and height // 2. then calculates the user's body-mass-index (BMI) // 3. and then prints

/////////////////////////////////////////////////////////////////////////////////// //This program // 1. asks the user her/his weight and height // 2. then calculates the user's body-mass-index (BMI) // 3. and then prints an appropriate message based on the user's BMI /////////////////////////////////////////////////////////////////////////////////// #include  using namespace std; void printWelcome(); // ask the weight (in pounds) and height (in inches) of the user and store the values in formal // parameters weight and height, respectively void getWeightAndHeight(float& weight, float& height); // calculate and return the BMI (Body-Mass-Index) based on the user's weight and height float calculateBMI(float weight, float height); // print a message to the user based on the user's BMI passed by the formal // parameter bmi. // ------------------------------------------------------------------------- // Use the following BMI Categories to print an appropriate message to the user // ----------------------------------------------------------------------- // Underweight if BMI =<18.5 // Normal weight if BMI is between 18.5 and 24.9 // Overweight if BMI is between 25 and 29.9 // Obesity if BMI of 30 or greater void printReport(float bmi); int main() { float w, h; // 0. Welcome printWelcome(); /////////////////////////////////////////////////////////////////////// // TO-DO: // - Complete the main program by calling the appropriate functions // appropriately // - Note that you must also complete the body of the functions below /////////////////////////////////////////////////////////////////////// // 1. ask the user her/his weight and height: call the getWeightAndHeight() function getWeightAndHeight(w, h); // 2. calculate the user's body-mass-index (BMI): call the calculateBMI() function // ... // 3. print an appropriate message based on the user's BMI: call printReport() function // ... system("pause"); return 0; } void printWelcome() { cout << "___________________________________________________________________________ " << "This program " << " 1. asks the user her/his weight and height " << " 2. then calculates the user's body-mass-index (BMI) " << " 3. and then prints an appropriate message based on the user's BMI " << "___________________________________________________________________________ "; } // ask the weight (in pounds) and height (in feet) of the user and store the values in formal // parameters weight and height, respectively void getWeightAndHeight(float& weight, float& height) { // complete the body of this function //... } // calculate and return the BMI (Body-Mass-Index) based on // the user's weight (in pounds) and height (in inches) // reference: http://extoxnet.orst.edu/faqs/dietcancer/web2/twohowto.html float calculateBMI(float weight, float height) { // complete the body of this function //... return 0.0; // also fix this line } // print a message to the user based on the user's BMI passed by the formal // parameter bmi. // ------------------------------------------------------------------------- // Use the following BMI Categories to print an appropriate message to the user // ----------------------------------------------------------------------- // Underweight if BMI =<18.5 // Normal weight if BMI is between 18.5 and 24.9 // Overweight if BMI is between 25 and 29.9 // Obesity if BMI of 30 or greater void printReport(float bmi) { // complete the body of this function //... 

}

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!