📄 temperature.java
字号:
//Copyright (c) 1998, Arthur Gittleman
//This example is provided WITHOUT ANY WARRANTY either expressed or implied.
/* Uses method from the Io class provided
* with the text, to convert degrees Celsius
* to degrees Fahrenheit
*/
import iopack.Io;
public class Temperature {
public static void main(String [ ] args) {
double hotC, coldC;
double hotF, coldF;
hotC = Io.readDouble("Enter a hot temperature in Celsius");
hotF = 9.0*hotC/5.0 + 32.0;
System.out.print("The Fahrenheit temperature is: ");
Io.println(hotF, 1);
coldC = Io.readDouble("Enter a cold temperature in Celsius");
coldF = 9.0*coldC/5.0 + 32.0;
System.out.print("The Fahrenheit temperature is: ");
Io.println(coldF,1);
Io.readString("Press any key to exit"); // Added for IDE use
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -