/* This program coverts a temperature in Fahrenheit to Celsius. * Input will be from a dialog box, output will be to the console * * ********************* F O R M U L A ************************* * * C = 5.0/9.0 * (F - 32) * ************************************************************* * * @author Anthony Larrain */ import javax.swing.JOptionPane; class FahrenheitToCelsius{ public static void main( String arg [ ]){ // Declaration of primitive variables double farenheit,celsius; // Declaration of reference variable String input; input = JOptionPane.showInputDialog("Enter Temperature in Fahrenheit"); farenheit = Double.parseDouble(input); celsius = (5.0/9.0) * (farenheit - 32); System.out.println(farenheit + "F -----> " + celsius + "C"); System.exit(0); } }