herrDeng網內搜尋

自訂搜尋

Ads

2011年5月19日 星期四

計算BMI

BMI (Body Mass Index)= 體重 (kg) / 身高 ^2(m2)
在台灣,行政院衛生署乃根據其相關研究,於2002年4月公佈台灣成人肥胖標準:
  • BMI<18.5 為過輕,
  • 18.5≦BMI<24 為正常體重,
  • 24≦BMI<27 為過重,
  • BMI≧27 即為肥胖。

34 則留言:

B9933068 提到...

import java.util.*;
class BMI
{
public static double BMIcompute(double m,double w)
{
return w/((m/100)*(m/100));
}
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.println("請輸入身高");
double m=input.nextDouble();
System.out.println("請輸入體重");
double w=input.nextDouble();
double BMI=BMIcompute (m,w);
System.out.println(BMI);
if(BMI<18.5)
System.out.println("過輕");
else if(18<=BMI&&BMI<24)
System.out.println("正常");
else if(24<=BMI&&BMI<27)
System.out.println("過重");
else
System.out.println("肥胖");
}
}

Unknown 提到...

import java.util.*;
class java {
public static double BMIcompute(double m,double w)
{
return w/(m*m);
}
public static void main(String[] args)throws Exception{
Scanner input=new Scanner(System.in);
System.out.println("請輸入身高(公分)");
Double m=input.nextDouble();
m=m/100;
System.out.println("請輸入體重(公斤)");
Double w=input.nextDouble();
Double BMI=BMIcompute(m,w);
System.out.println(BMI);
if(BMI<18.5)
System.out.print("過輕");
else if(18<=BMI&&BMI<24)
System.out.print("正常");
else if(24<=BMI&&BMI<27)
System.out.print("過重");
else
System.out.print("肥胖");
}
}

B9933061 提到...

import java.util.*;
public class java{
public static double BMIcompute(double m,double w){
return w/(m*m);
}
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.print("輸入體重");
double w=input.nextDouble();
System.out.print("輸入身高");
double m=input.nextDouble();
m=m/100;
double BMI=BMIcompute(m,w);
System.out.println(BMI);
if (BMI<18.5)
System.out.print("過輕");
else if (18<=BMI&&BMI<24)
System.out.print("正常");
else if (24<=BMI&&BMI<27)
System.out.print("過重");
else
System.out.print("肥胖");

}
}

B9733202 提到...

import java.util.*;
class BMI
{
public static double b(double w,double m)
{
return w/(m*m);
}
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.println("輸入體重(單位kg)");
double w = input.nextInt();
System.out.println("輸入身高(單位cm)");
double m = input.nextInt();
double BMI = b(w,m/100);
System.out.println("BMI="+BMI);
if(BMI < 18.5)
System.out.println("過輕");
else if(18.5<=BMI&&BMI<24)
System.out.println("正常");
else if(24<=BMI&&BMI<27)
System.out.println("過重");
else
System.out.println("肥胖");
}
}

B9933108 提到...

import java.util.*;
public class ggggg{
public static double BMIcompute(double m,double w){
return w/(m*m);
}
public static void main(String[]args){
Scanner input=new Scanner(System.in);
System.out.println("輸入體重");
double w=input.nextDouble();
System.out.println("輸入身高");
double m=input.nextDouble();
m=m/100;
double BMI=BMIcompute(m,w);
System.out.println(BMI);
if(BMI<18.5)
System.out.print("過輕");
else if(18<=BMI&&BMI<24)
System.out.print("正常");
else if(24<=BMI&&BMI<27)
System.out.print("過重");
else
System.out.print("肥胖");
}
}

B9933097 提到...

import javax.swing.*;
class BMI{
public static double BMIcompute(double m,double w)
{
return w/(m*m);
}
public static void main(String[] arg)throws Exception
{
double m=new Double(JOptionPane.showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.showInputDialog("體重(公斤)w=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI="+BMI);
if(18.5<=BMI&&BMI<24)
System.out.println("正常體重");
else if(BMI<18.5)
System.out.println("過輕");
else if(24<=BMI&&BMI<27)
System.out.println("過重");
else if(BMI>=27)
System.out.println("肥胖");
}

}

b9933110 提到...

import javax.swing.*;
public class kk{
public static double BMIcompute (double m,double w)
{
return w/(m*m);
}

public static void main(String[]args)throws Exception
{
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)w=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,
"BMI="+BMI);
if(BMI < 18.5)
System.out.printf("體重過輕");
else if(BMI >= 18.5 && BMI <= 24)
System.out.printf("標準身材");
else if(BMI >= 24 && BMI < 27)
System.out.printf("體重過重");
else if(BMI >= 27 )
System.out.printf("肥胖");

}
}

B9933106 提到...

import java.util.*;
class BMI{
public static double BMIcompute(double m,double w){
return w/(m*m);
}
public static void main(String[]argv){
Scanner input=new Scanner(System.in);
System.out.print("輸入身高");
double m=input.nextDouble();
System.out.print("輸入體重");
double w=input.nextDouble();
m=m/100;
double BMI=BMIcompute(m,w);
System.out.println(BMI);
if(BMI<18.5)
System.out.print("過輕");
else if(18<=BMI&&BMI<24)
System.out.print("普通");
else if(24<=BMI&&BMI<27)
System.out.print("過重");
else
System.out.print("肥胖");
}
}

柏修 提到...

import java.util.*;
class BMI{
public static double BMIcompute(double m,double w){
return w/(m*m);
}
public static void main(String[]argv){
Scanner input=new Scanner(System.in);
System.out.print("輸入身高");
double m=input.nextDouble();
System.out.print("輸入體重");
double w=input.nextDouble();
m=m/100;
double BMI=BMIcompute(m,w);
System.out.println(BMI);
if(BMI<18.5)
System.out.print("過輕");
else if(18<=BMI&&BMI<24)
System.out.print("普通");
else if(24<=BMI&&BMI<27)
System.out.print("過重");
else
System.out.print("肥胖");
}
}

B9933085 提到...

import java.util.*;
public class BMI {
public static double BMIcompute(double m,double w)throws Exception
{
return w/(m*m);
}
public static void main(String []avgs)throws Exception{
Scanner input= new Scanner(System.in);
System.out.println("身高(公分)m=");
double m=input.nextDouble();
m=m/100;
System.out.println("體重(公斤)w=");
double w=input.nextDouble();
double BMI=BMIcompute(m,w);
System.out.println(BMI);
if(BMI<18.5)
System.out.print("過輕");
else if(18<=BMI&&BMI<24)
System.out.print("正常");
else if(24<=BMI&&BMI<27)
System.out.print("過重");
else
System.out.print("肥胖");


}
}

B9933066 提到...

import java.util.*;
class BMI{
public static double BMIcompute (double m,double w){
return w/(m*m);
}
public static void main (String [] argv){
Scanner input=new Scanner (System.in);
System.out.println("輸入體重");
double w=input.nextDouble();
System.out.println("輸入身高");
double m=input.nextDouble();
m=m/100;
double BMI=BMIcompute(m,w);
System.out.println(BMI);
if(BMI<18.5)
System.out.print("過輕");
else if(18<=BMI&&BMI<24)
System.out.print("正常");
else if(24<=BMI&&BMI<27)
System.out.print("過胖");
else
System.out.print("肥胖");
}
}

b9933064 提到...

import javax.swing.*;
public class bmi {
public static double BMIcompute(double m, double w){
return w/(m*m);
}
public static void main(String[]args){
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)w=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI="+BMI);
if(BMI < 18.5)
System.out.print("過輕");
else if(BMI >= 18.5 && BMI <= 24)
System.out.print("正常體重");
else if(BMI >= 24 && BMI < 27)
System.out.print("過重");
else if(BMI >= 27 )
System.out.print("肥胖");
}

B9933078 提到...

import javax.swing.*;
public class BMI{
public static double BMIcompute(double m,double w){
return w/(m*m);
}
public static void main (String [] args){
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)w=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI="+BMI);
if(BMI < 18.5)
System.out.println("過輕");
else if(BMI >= 18.5 && BMI < 24)
System.out.println("正常體重");
else if(BMI >= 24 && BMI < 27)
System.out.println("過重");
else if(BMI >= 27 )
System.out.println("肥胖");
}
}

b9933089 提到...

import javax.swing.*;
public class bmi {
public static double BMIcompute(double m, double w){
return w/(m*m);
}
public static void main(String[]args){
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)w=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI="+BMI);
if(BMI < 18.5)
System.out.print("過輕");
else if(BMI >= 18.5 && BMI <= 24)
System.out.print("正常體重");
else if(BMI >= 24 && BMI < 27)
System.out.print("過重");
else if(BMI >= 27 )
System.out.print("肥胖");
}

b9933087 提到...

import javax.swing.*;
public class bmi {
public static double BMIcompute(double m, double w){
return w/(m*m);
}
public static void main(String[]args){
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)w=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI="+BMI);
if(BMI < 18.5)
System.out.print("過輕");
else if(BMI >= 18.5 && BMI <= 24)
System.out.print("正常體重");
else if(BMI >= 24 && BMI < 27)
System.out.print("過重");
else if(BMI >= 27 )
System.out.print("肥胖");
}

B9933070 提到...

import javax.swing.*;
public class BMI {


public static double BMIcompute (double m,double w) {
return w/(m*m);
}
public static void main(String[]args){
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)m=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI"+BMI);




}
}

A9933058 提到...

import javax.swing.*;
class kk{
public static double BMIcompute (double m,double w)
{
return w/(m*m);
}

public static void main(String[]args)throws Exception
{
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)w=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,
"BMI="+BMI);
if(BMI < 18.5)
System.out.printf("體重過輕");
else if(BMI >= 18.5 && BMI <= 24)
System.out.printf("標準身材");
else if(BMI >= 24 && BMI < 27)
System.out.printf("體重過重");
else if(BMI >= 27 )
System.out.printf("肥胖");

}
}

b9933115 提到...

import javax.swing.*;
public class f {


public static double BMIcompute (double m,double w) {
return w/(m*m);
}
public static void main(String[]args){
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)m=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI"+BMI);

}
}

B9933067 提到...

import javax.swing.*;
public class BMI {


public static double BMIcompute (double m,double w) {
return w/(m*m);
}
public static void main(String[]args){
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)m=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI"+BMI);

}
}

b9933093 提到...

import javax.swing.*;
public class BMI{
public static double BMIcompute(double m, double w){
return w/(m*m);
}
public static void main(String[] args) {
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)w=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI="+BMI);
if(BMI < 18.5)
System.out.println("過輕");
else if(BMI >= 18.5 && BMI <= 24)
System.out.println("正常");
else if(BMI >= 24 && BMI < 27)
System.out.println("過重");
else if(BMI >= 27 )
System.out.println("肥胖");
}
}

b9933071 提到...

import javax.swing.*;
public class BMI {


public static double BMIcompute (double m,double w) {
return w/(m*m);
}
public static void main(String[]args){
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)m=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI"+BMI);

}
}

b9933094 提到...

import javax.swing.*;
public class BMI{
public static double BMIcompute(double m, double w){
return w/(m*m);
}
public static void main(String[] args) {
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)w=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI="+BMI);
if(BMI < 18.5)
System.out.println("過輕");
else if(BMI >= 18.5 && BMI <= 24)
System.out.println("正常");
else if(BMI >= 24 && BMI < 27)
System.out.println("過重");
else if(BMI >= 27 )
System.out.println("肥胖");
}
}

b9933063 提到...

import javax.swing.*;
public class BMI {


public static double BMIcompute (double m,double w) {
return w/(m*m);
}
public static void main(String[]args){
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)m=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI"+BMI);

}
}

b9933073 提到...

import javax.swing.*;
public class BMI {


public static double BMIcompute (double m,double w) {
return w/(m*m);
}
public static void main(String[]args){
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)m=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI"+BMI);

}
}

b9933080 提到...

import javax.swing.*;
public class BMI {


public static double BMIcompute (double m,double w) {
return w/(m*m);
}
public static void main(String[]args){
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)m=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI"+BMI);

}
}

a9933056 提到...

import javax.swing.*;
class razer{
public static double BMIcompute (double m,double w)
{
return w/(m*m);
}

public static void main(String[]args)throws Exception
{
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)w=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,
"BMI="+BMI);
if(BMI < 18.5)
System.out.printf("體重過輕");
else if(BMI >= 18.5 && BMI <= 24)
System.out.printf("標準身材");
else if(BMI >= 24 && BMI < 27)
System.out.printf("體重過重");
else if(BMI >= 27 )
System.out.printf("肥胖");

}
}

A9933059 提到...

import javax.swing.*;
class block{
public static double BMIcompute (double m,double w)
{
return w/(m*m);
}

public static void main(String[]args)throws Exception
{
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)w=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,
"BMI="+BMI);
if(BMI < 18.5)
System.out.printf("體重過輕");
else if(BMI >= 18.5 && BMI <= 24)
System.out.printf("標準身材");
else if(BMI >= 24 && BMI < 27)
System.out.printf("體重過重");
else if(BMI >= 27 )
System.out.printf("肥胖");

}
}

B9933072 提到...

import javax.swing.*;
public class BMI {


public static double BMIcompute (double m,double w) {
return w/(m*m);
}
public static void main(String[]args){
double m=new Double(JOptionPane.
showInputDialog("身高(公分)m=")).doubleValue();
double w=new Double(JOptionPane.
showInputDialog("體重(公斤)m=")).doubleValue();
double BMI=BMIcompute(m/100,w);
JOptionPane.showMessageDialog(null,"BMI"+BMI);

}
}

B9933109 提到...

import java.util.*;
class bmi
{
public static double BMIcompute(double m,double w)
{
return (w/m*m) ;
}
public static void main (String [] argv)
{
Scanner input=new Scanner (System.in);
System.out.println("輸入體重");
double w=input.nextDouble();
System.out.println("輸入身高");
double m=input.nextDouble();
m=m/100;
double BMI=BMIcompute(m,w);
System.out.println(BMI);
if (BMI<18.5)
System.out.print("過輕");
else if (18.5<=BMI&&BMI<24)
System.out.print("正常體重");
else if (24<=BMI&&BMI<27)
System.out.print("過重");
else
System.out.print("肥胖");
}
}

b9933069 提到...

import java.util.*;
public class BMI {
public static double BMIcompute(double m,double w)throws Exception
{
return w/(m*m);
}
public static void main(String []avgs)throws Exception{
Scanner input= new Scanner(System.in);
System.out.println("身高(公分)m=");
double m=input.nextDouble();
m=m/100;
System.out.println("體重(公斤)w=");
double w=input.nextDouble();
double BMI=BMIcompute(m,w);
System.out.println(BMI);
if(BMI<18.5)
System.out.print("過輕");
else if(18<=BMI&&BMI<24)
System.out.print("正常");
else if(24<=BMI&&BMI<27)
System.out.print("過重");
else
System.out.print("肥胖");


}
}

b9933098 提到...

import java.util.*;
public class BMI {
public static double BMIcompute(double m,double w)throws Exception
{
return w/(m*m);
}
public static void main(String []avgs)throws Exception{
Scanner input= new Scanner(System.in);
System.out.println("身高(公分)m=");
double m=input.nextDouble();
m=m/100;
System.out.println("體重(公斤)w=");
double w=input.nextDouble();
double BMI=BMIcompute(m,w);
System.out.println(BMI);
if(BMI<18.5)
System.out.print("過輕");
else if(18<=BMI&&BMI<24)
System.out.print("正常");
else if(24<=BMI&&BMI<27)
System.out.print("過重");
else
System.out.print("肥胖");


}
}

b9933103 提到...

import java.util.*;
public class BMI {
public static double BMIcompute(double m,double w)throws Exception
{
return w/(m*m);
}
public static void main(String []avgs)throws Exception{
Scanner input= new Scanner(System.in);
System.out.println("身高(公分)m=");
double m=input.nextDouble();
m=m/100;
System.out.println("體重(公斤)w=");
double w=input.nextDouble();
double BMI=BMIcompute(m,w);
System.out.println(BMI);
if(BMI<18.5)
System.out.print("過輕");
else if(18<=BMI&&BMI<24)
System.out.print("正常");
else if(24<=BMI&&BMI<27)
System.out.print("過重");
else
System.out.print("肥胖");


}
}

b9933114 提到...

import java.util.*;
class BMI
{
public static double BMIcompute(double m,double w)
{
return w/((m/100)*(m/100));
}
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.println("請輸入身高");
double m=input.nextDouble();
System.out.println("請輸入體重");
double w=input.nextDouble();
double BMI=BMIcompute (m,w);
System.out.println(BMI);
if(BMI<18.5)
System.out.println("過輕");
else if(18<=BMI&&BMI<24)
System.out.println("正常");
else if(24<=BMI&&BMI<27)
System.out.println("過重");
else
System.out.println("肥胖");
}
}

b9933116 提到...

import java.util.*;
class java {
public static double BMIcompute(double m,double w)
{
return w/(m*m);
}
public static void main(String[] args)throws Exception{
Scanner input=new Scanner(System.in);
System.out.println("請輸入身高(公分)");
Double m=input.nextDouble();
m=m/100;
System.out.println("請輸入體重(公斤)");
Double w=input.nextDouble();
Double BMI=BMIcompute(m,w);
System.out.println(BMI);
if(BMI<18.5)
System.out.print("過輕");
else if(18<=BMI&&BMI<24)
System.out.print("正常");
else if(24<=BMI&&BMI<27)
System.out.print("過重");
else
System.out.print("肥胖");
}
}

Related Posts Plugin for WordPress, Blogger...

熱門文章