COSC-2425 Programming Project 4 Create an assembly language program that calcula
ID: 665697 • Letter: C
Question
COSC-2425 Programming Project 4
Create an assembly language program that calculates a person’s Body Mass Index (BMI). Use floating-point variables and the floating-point instructions found and described in Chapter 12.
You will need the person’s height in inches and their weight in pounds.
The formula to calculate the Body Mass Index is:
BMI = ( W * 703 ) / ( H * H )
Where: BMI = Body Mass Index
W = weight in pounds
H = height in inches
In addition to correctly calculating the numeric value of the BMI, your program should also display the descriptive word that corresponds to the following range of BMI values:
Range of BMI Values
Description
Less than 18.5
Underweight
18.5 or greater, but less than 25
Normal
25 or greater, but less than 30
Overweight
30 or greater
Obese
Your program should do the following:
1. Prompt the user for their weight in pounds.
2. Prompt the user for their height in inches.
3. Echo the weight and height values back to the User.
3. Calculate and display the BMI value.
4. Display the descriptive word that corresponds to their BMI value.
Range of BMI Values
Description
Less than 18.5
Underweight
18.5 or greater, but less than 25
Normal
25 or greater, but less than 30
Overweight
30 or greater
Obese
Explanation / Answer
#include #include #include // For BMI equation #include // For 2 decimal places int main() { /*************************Local Variables*****************************/ float height_in_feet; //user's height in feet float height_in_inches; // user's height in inches float total_height_in_inches; //The user's total height stored in float float weight_in_pounds; //The user's weight stored in float float BMI; //The user's calculated BMI char endProgram; //Pause screen /**********************************************************************/ //Prompt the user to input their weight cout > weight_in_pounds; //Prompt the user to input their height in feet cout > height_in_feet; //Prompt the user to input their height in inches cout > height_in_inches; //Find total height in inches total_height_in_inches = (height_in_feet * 12) + height_in_inches; //Calculate BMI using the supplied equation BMI = weight_in_pounds / pow(total_height_in_inches,2)*703; //Display BMI to user coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.