這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
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("肥胖"); } }
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("肥胖"); }}
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("肥胖"); } }
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("肥胖"); }}
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("肥胖"); } }
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("肥胖"); } }
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("肥胖"); }}
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.*;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("肥胖"); } }
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("肥胖");}}
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("肥胖"); }
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("肥胖"); }}
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); }}
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("肥胖"); }}
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);}}
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); }}
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("肥胖"); }}
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("肥胖"); }}
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("肥胖"); }}
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);}}
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("肥胖"); } }
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("過重");elseSystem.out.print("肥胖");} }
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("過重");elseSystem.out.println("肥胖"); } }
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("過重");elseSystem.out.print("肥胖");}}
張貼留言
34 則留言:
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("肥胖");
}
}
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("肥胖");
}
}
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("肥胖");
}
}
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("肥胖");
}
}
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("肥胖");
}
}
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("肥胖");
}
}
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("肥胖");
}
}
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("肥胖");
}
}
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("肥胖");
}
}
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("肥胖");
}
}
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("肥胖");
}
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("肥胖");
}
}
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("肥胖");
}
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("肥胖");
}
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);
}
}
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("肥胖");
}
}
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);
}
}
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);
}
}
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("肥胖");
}
}
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);
}
}
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("肥胖");
}
}
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);
}
}
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);
}
}
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);
}
}
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("肥胖");
}
}
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("肥胖");
}
}
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);
}
}
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("肥胖");
}
}
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("肥胖");
}
}
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("肥胖");
}
}
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("肥胖");
}
}
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("肥胖");
}
}
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("肥胖");
}
}
張貼留言