📄 wallcalculations2.java
字号:
/*
* WallCalculations2.java E.L. 2001-06-16
*/
import javax.swing.JOptionPane;
class WallCalculations2 {
public static void main(String[] args) {
String lengthInput = JOptionPane.showInputDialog("The length of the wall (meters): ");
String heightInput = JOptionPane.showInputDialog("The height of the wall (meters): ");
double length = Double.parseDouble(lengthInput);
double height = Double.parseDouble(heightInput);
double area = length * height;
JOptionPane.showMessageDialog(null,
"The area of the wall is " + area + " square meters.");
System.exit(0);
}
}
/* Example Run:
Length: 5.8 m
Height: 2.4 m
The area of the wall is 13.92 square meters.
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -