大家帮帮我 我跪求大家了
import javax.swing.JOptionPane;
public class Temperature
{
public static void main( String args[] )
{
int option;
int degree1;
int celsius1;
int fahrenheit1;
String result;
String degree;
String fahrenheit;
String input;
String celsius;
option = 0;
do
(
input = JOptionPane.showInputDialog(" 1 for Fahrenheit to Celsius\n" +" 2 for Celsius to Fahrenheit\n 3 to quit:" );
)
While ( option != 3 )
{
option = Double.parseDouble( input );
if ( option == 1 )
{
degree = JOptionPane.showInputDialog( "Enter the degree in Fahrenheit: " );
degree1 = Double.parseDouble( degree );
celsius1 = ( degree1 - 32 ) * 5 / 9;
result = "The temp in Celsius is " + celsius1;
JOptionPane.showMessageDialog( null, result, "Result", JOptionPane.INFORMATION_MESSAGE );
}
if ( option == 2 )
{
degree = JOptionPane.showInputDialog( "Enter degree in Celsius: " );
degree1 = Double.parseDouble( degree );
fahrenheit1= ( degree1 * 9 / 5 ) + 32;
result = "The temp in Fahrenheit is " + fahrenheit1;
JOptionPane.showMessageDialog( null, result, "Result",
JOptionPane.INFORMATION_MESSAGE );
}
System.exit( 0 );
} // end while loop
} // end method Main
} // end class Temperature
错误在那里呀 我这没有报错信息啊