java语言程序设计(基础篇)第十版编程练习题[2.14]
2019-01-06 08:20
197 查看
(医疗应用程序:计算 BMI) 身体质量指数(BMI) 是对体重的健康测量。它的值可以通过将体重(以公斤为单位)除以身高(以米为单位)的平方值得到。编写程序,提示用户输人体重(以磅为单位)以及身髙(以英寸为单位),然后显示 BMI。注意:一磅是 0.4S3S9237公斤,一英
寸是 0.0254 米。
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package dome2_14; import java.util.Scanner; /** * * @author Administrator */ public class Dome2_14 { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here Scanner in = new Scanner(System.in); System.out.print("Enter weight in pounds: "); double weight = in.nextDouble(); System.out.print("Enter height in inches: "); double height = in.nextDouble(); double BMI = (weight * 0.45359237) / Math.pow((height * 0.0254), 2); System.out.println("BMI is " + BMI); } }
相关文章推荐
- java语言程序设计(基础篇)第十版编程练习题[2.20]
- java语言程序设计(基础篇)第十版编程练习题[2.21]
- java语言程序设计(基础篇)第十版编程练习题[2.15]
- java语言程序设计(基础篇)第十版编程练习题[2.16]
- java语言程序设计(基础篇)第十版编程练习题[2.17]
- java语言程序设计(基础篇)第十版编程练习题[2.18]
- java语言程序设计(基础篇)第十版编程练习题[2.19]
- Java程序语言设计基础篇原书第十版第三章答案编程练习题
- Java语言程序设计基础篇原书第十版第二章编程练习题答案
- Java语言程序设计基础篇原书第十版第四章编程练习题答案
- 【Java语言程序设计(基础篇)第10版 练习题答案】Practice_6_1
- Java语言程序设计(基础篇)原书第10版 练习题答案 7.21
- 【Java语言程序设计(基础篇)第10版 练习题答案】Practice_6_2
- Java语言程序设计-基础篇-第八版-编程练习题-第五章
- 【Java语言程序设计(基础篇)第10版 练习题答案】Practice_6_3
- Java语言程序设计-基础篇-第八版-编程练习题-第三章
- Java语言程序设计-基础篇-第八版-编程练习题-第六章
- 【Java语言程序设计(基础篇)第10版 练习题答案】Practice_9_5
- Java语言程序设计(基础篇)第十版
- Java程序语言(基础篇)第2章 基本程序设计 编程练习题解答