📄 exercise2_4.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -