Prelim C++

Prelim Laboratory Exam

Write a short program that asks for your height in feet and inches and your weight in pounds. (Use three variables to store the information.) Have your program report your BMI (Body Mass Index). To calculate the BMI, first convert your height in feet and inches to height in inches. Then, convert your height in inches to your height in meters by multiplying by 0.0254. Then, convert your weight in pounds into your mass in kilograms by dividing by 2.2. Finally, compute your BMI by dividing your mass in kilograms by your height in meters squared. Use symbolic constants to represent conversion factors and output the answer to the console.

Post a Comment

0 Comments