Chapter 2: Problem 33
We introduced the body mass index (BMI) calculator in Exercise 1.10. The formulas for calculating BMI are $$B M I=\frac{\text {weightInPounds} \times 703}{\text {heightInInches} \times \text {heightInInches}}$$ or $$B M I=\frac{\text {weightln Kilograms}}{\text {height} \text {InMeters} \times \text {height} \text {InMeters}}$$ Create a BMI calculator that reads the user鈥檚 weight in pounds and height in inches (or, if you prefer, the user鈥檚 weight in kilograms and height in meters), then calculates and displays the user鈥檚 body mass index. Also, display the following information from the Department of Health and Human Services/National Institutes of Health so the user can evaluate his/her BMI: [Note: In this chapter, you learned to use the int type to represent whole numbers. The BMI calculations when done with int values will both produce whole-number results. In Chapter 3 you鈥檒l learn to use the double type to represent numbers with decimal points. When the BMI calculations are performed with doubles, they鈥檒l both produce numbers with decimal points鈥攖hese are called 鈥渇loating-point鈥 numbers.]
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.