首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
首页
>
试题广场
>
(医疗应用程序:计算 BMI) 身体质量指数(BMI) 是
[问答题]
(医疗应用程序:计算 BMI) 身体质量指数(BMI) 是对体重的健康测量。它的值可以通过将体 重(以公斤为单位)除以身高(以米为单位)的平方值得到。编写程序,提示用户输人体重(以 磅为单位)以及身髙(以英寸为单位),然后显示 BMI。注意:一磅是 0.4S3S9237公斤,一英 寸是 0.0254 米。下面是一个运行示例:
添加笔记
求解答(0)
邀请回答
收藏(1)
分享
纠错
1个回答
添加回答
0
桃奈叶子
package AA;
import java.util.Scanner;
public class ah {
public static void main(String[] args){
double weight,height,pounds,inches;
System.out.print("Enter weight in pounds:");
Scanner in=new Scanner(System.in);
pounds=in.nextDouble();
System.out.print("Enter height in inches:");
Scanner s=new Scanner(System.in);
inches=s.nextDouble();
double BMI=0;
weight=pounds*0.45359237;
height=inches*0.0254;
BMI=weight/Math.pow(height,2);
System.out.print("BMI is"+String.format("%.4f",BMI));
}
}
发表于 2021-04-06 15:32:33
回复(0)
这道题你会答吗?花几分钟告诉大家答案吧!
提交观点
问题信息
上传者:
小小
难度:
1条回答
1收藏
707浏览
热门推荐
相关试题
考虑以下Verilog代码片段,其...
Verilog
评论
(1)
在一个大型设计中,模块A (`a....
Verilog
评论
(1)
为了评估一个新上线的在线交易系统在...
软件测试
评论
(1)
某Spring Bean同时使用了...
Spring
评论
(1)
在Linux中,如何将当前终端会话...
Linux
评论
(1)
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题