⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 converttemp.java

📁 《A first book of java》by Gary J.Bronson 北大出版社
💻 JAVA
字号:
import javax.swing.*;
public class ConvertTemp
{
  public static void main (String[] args) 
  {
     String fahr, output;
     double tempfahr, celsius;
     fahr = JOptionPane.showInputDialog("Enter a Fahrenheit Temperature:");
    
     tempfahr = Double.parseDouble(fahr);
     celsius = 5.0/9.0 * (tempfahr - 32);
     
     output = "The equivalent Celsius temperature for " + tempfahr
            + " degrees Fahrenheit is " + celsius;
     JOptionPane.showMessageDialog(null, output, "Program 3.14",
                                   JOptionPane.INFORMATION_MESSAGE);
    System.exit(0);
 }
}

⌨️ 快捷键说明

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