Hi all,
I am working on a project for class and I've been tinkering with my code, but I can't seem to solve my error. I am not asking for someone to do my code, but I'm just hoping for a little nudge in the right direction. Any help would be appreciated. I have a couple of hours to knock this out.
The assignment reads: Develop a Java program (F2C.java) for converting a temperature from the Fahrenheit to the Celsius scale. The program will read the temperature graphically using an input dialog box (JOptionPane.showInputDialog) and will show also the result graphically on a message dialog box (JOptionPane.showMessageDialog).
I can get my input box to show, but I am unable to get to the output box
What I have came up with:
/*
*/
import javax.swing.JOptionPane;
public class F2C {
public static void main(String[] args) {
// Enter Farenheit
String Fahrenheit = JOptionPane.showInputDialog(
"Enter temperature in Fahrenheit:");
//Process
temperature = (temperature-32) * (5f/9);
// Display results
String output = "nTemperature in Celcius" + String.format("%.2f",temperature);
JOptionPane.showMessageDialog(null, output);
}
}