*3.6(健康应用:BMI)修改程序清单3-4,让用户输入重量、英尺和英寸。例如一个人身高是5英尺10英寸,输入的英尺值就是5、英寸值为10。注意:1英尺=0.3048米。
下面是一个运行示例:
Enter weight in pounds:140
Enter feet:5
Enter inches:10
BMI is 20.087702275404553
*3.6(Health application: BMI) Revise Listing 3.4, ComputeAndInterpretBMI.java, to let the user enter weight, feet, and inches. For example, if a person is 5 feet and 10 inches, you will enter 5 for feet and 10 for inches.
Here is a sample run:
Enter weight in pounds:140
Enter feet:5
Enter inches:10
BMI is 20.087702275404553
下面是参考答案代码:
import java.util.*;
public class ComputeAndInterpretBMIQuestion6 {
public static void main(String[] args) {