📄 convtemp.txt
字号:
// Computes the Fahrenheit equivalent of 20 Celsius
import javax.swing.JOptionPane;
public class ConvTemp
{
public static void main(String[] args)
{
// ratio of F degree to C degree
final double FACTOR = 9.0 / 5.0;
final double SHIFT = 32; // 0 C = 32 F
double cel = 20; // temp for conversion
double fah; // Fahrenheit equivalent
// do the calculation
fah = cel * FACTOR + SHIFT;
// output the answer
JOptionPane.showMessageDialog(null,
"The Fahrenheit equivalent of 20 Celsius is "
+ fah + " F");
System.exit(0);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -