exercise2_4.java

来自「java程序设计导论(daniel liang著) 所有偶数课后习题答案」· Java 代码 · 共 19 行

JAVA
19
字号
import javax.swing.JOptionPane;

public class Exercise2_4 {
  public static void main(String[] args) {
    // Prompt the input
    String poundString = JOptionPane.showInputDialog(null,
      "Enter a number in pound:",
      "Exercise2_4 Input", JOptionPane.QUESTION_MESSAGE);

    // Convert string to double
    double pound = Double.parseDouble(poundString);
    double kilogram = pound * 0.454;

    System.out.println("It is " + kilogram + " kilograms");

    System.exit(0);
  }
}


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?