I got this to run but it will not display the final result. It ask for C or F then the temp degree but will not display the conversion. The process just completes. Any ideas? I am new here....
Thanks
My project::-/
import javax.swing.JOptionPane;
public class Assign8_Cheshire
{
public static void main(String[] args)
{
double result;
String degree;
int input;
degree = JOptionPane.showInputDialog("Enter: \n C - Fahrenheit to Celsius\n F - Celsius to Fahrenheit");
input = new Integer(JOptionPane.showInputDialog("Enter the degree: ")).intValue();
if(degree == "C" || degree == "c")
{
result = 5.0/9.0 * (input - 32);
JOptionPane.showMessageDialog(null," Fahrenheit is " + result + " Celsius");
}
else if(degree == "F" || degree == "f")
{
result = 9.0/5.0 * input + 32;
JOptionPane.showMessageDialog(null, " Celsius is " + result + " Fahrenheit");
}
}
}