代码:
import javax.swing.*;
public class bb{
public static void mainString[] args){
String input = JOptionPane.showInputDialognull,”Enter a degree in Celsius”,”changeDegree”,JOptionPane.QUESTION_MESSAGE);
double Celsius = Double.parseDoubleinput);
double Fahrenheit = 9.0/5)*Celsius+32;
String result = Celsius+” Celsius is “+Fahrenheit+” Fahrenheit”;
JOptionPane.showMessageDialognull,result);
}
}
结果: