I’m taking an online course using JAVA Programming(4th Edition)by Joyce Farrell. I am at an excercise I just can’t get past.
I’m trying to write a script that can convert Fahrenheit to Centigrade, but I can’t seem to resolve my last few errors.
import javax.swing.JOptionPane;
public class TEST
{
public static void main(String[] args)
{
String FahrenheitString;
double Fahrenheit;
double Centigrade;
FahrenheitString = JOptionPane.showInputDialog(null,”Enter the Temperature in Fahrenheit “,
“Temperature in FAHRENHEIT”, JOptionPane.INFORMATION_MESSAGE);
Temp = Double.parseDouble(FahrenheitString);
Centigrade = 5/9(FahrenheitString – 32);
JOptionPane.showMessageDialog (null, “The temperature in CENTIGRADES is + C=5/9(Fahrenheit-32”);
System.exit(0);
}
}
Seems I have 3 errors due to “Centigrade = 5/9(FahrenheitString – 32);”
and 3 due to “JOptionPane.showMessageDialog (null, “The temperature in CENTIGRADES is
“+ C=5/9(Fahrenheit-32”);
I just can’t figure it out. Any guidance will be GREATLY appreciated.