标签:
代码:
import javax.swing.*;
public class bb{
public static void main(String[] args){
String input = JOptionPane.showInputDialog(null,"Enter a degree in Celsius","changeDegree",JOptionPane.QUESTION_MESSAGE);
double Celsius = Double.parseDouble(input);
double Fahrenheit = (9.0/5)*Celsius+32;
String result = Celsius+" Celsius is "+Fahrenheit+" Fahrenheit";
JOptionPane.showMessageDialog(null,result);
}
}
结果:
标签:
原文地址:http://www.cnblogs.com/ncuhwxiong/p/5846877.html