Question
February 8, 2008 at 09:28 AM
mikev9359

JAVA compilation errors

by mikev9359 . Updated 18 years, 5 months ago

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.

This discussion is locked

All Comments