英尺转换米

import javax.swing.JOptionPane;
public class Foot {
    public static void main(String[] srgs){
        String input = JOptionPane.showInputDialog(null,"请输入米数:","输入框",JOptionPane.QUESTION_MESSAGE);
        double feet = Double.parseDouble(input);
        System.out.println(feet + " feet is " + feet * 0.305 +" meters ");
        
    }
}

编写程序,读入英尺数,将其转换为米数并显示结果。一英尺等于0.305米。

posted @ 2014-08-06 14:43  Amoxicil  阅读(1311)  评论(0编辑  收藏  举报