hi all. i need to write an application class with a main method and a second method called tempCalc, and then in the second method put the code from a previouse temperature calculation experiment. but i have no idea how to do this. i read the part in "Sams Teach Yourself Java2 in 21 days" about methods and calling methods but i cant get this working. please help me.
this is the tempCalc.java
import javax.swing.JOptionPane;
public class tempCalc
{
public static void main (String[]args)
{
String inString = JOptionPane.showInputDialog("Enter degrees Fahrenheit");
double fahrenheit = Double.parseDouble(inString);
double num1 = 5;
double num2 = 9;
double num3 = 32;
double num4 = ((num1/num2) * (fahrenheit - num3)) ;
System.out.println("Degrees in Celsius is (" +num4+ ")");
System.exit (0);
}
}
any help, even a finger pointing in the direction of a tutorial would help. im just quite stumped here.
thankyou.