Question: I need the code for this Pseudocode on C++ using variable String. Body Mass Index Write a program that calculates and displays a persons body
I need the code for this Pseudocode on C++ using variable String.
-
Body Mass Index
Write a program that calculates and displays a persons body mass index (BMI). The BMI is often used to determine whether a person with a sedentary lifestyle is over- weight or underweight for his or her height. A persons BMI is calculated with the following formula:
BMI = weight x 703 / height^2
where weight is measured in pounds and height is measured in inches. The program should display a message indicating whether the person has optimal weight, is under- weight, or is overweight. A sedentary persons weight is considered to be optimal if his or her BMI is between 18.5 and 25. If the BMI is less than 18.5, the person is consid- ered to be underweight. If the BMI value is greater than 25, the person is considered to be overweight.
Pseudocode
/ * start display "Enter the number of people who want to calculate the BMI:" input n for (counter = 1, counter <= n; counter ++) display "Enter your name": Input name display "Enter your height in feet and inches:" input feet, inches display "enter your weight in pounds:" input weight height = inches + feet x12 BMI = weight x 703 / (height) ^ 2 if (BMI <18.5) then display "You are underweight: underweight = underweight + 1 end if else if (BMI> = 18.5 AND BMI <= 25) then display "You are in optimal conditions" optimal = optimal + 1 end if else display "You are overweight" overweight = overweight + 1 end else end else End for
display "From", n "surveyed the results are:" display "underweight / n x 100"% are underweight " optimal display / n x 100 "% are in optimal conditions" display underweight / n x 100 "% are overweight" End * /
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
