第三章第六题(健康应用:BMI)(Health application: BMI)

*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) {
   
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值