Need help with Java program?

So i'm in an intro to java class and i'm making a Fahrenheit to Celsius converter, just for practice. I got it to work inside bluej, but when I try to run the jar file, nothing happens, but the program says that there are no syntax errors! here is my code:

import java.util.*;


public class main
{

private int farenheit;

main ()
{
farenheit = 70;
}

main ( int f )
{
farenheit = f;
}

public void setFarenheit (int differentFarenheit)
{
farenheit = differentFarenheit;
}

public void askUserForFarenheit ()
{
Scanner keyIn;
keyIn = new Scanner (System.in);

System.out.print ("Enter the temperature in Farenheit: ");
String input = keyIn.nextLine ();

int nFarenheit = Integer.parseInt (input) ;

setFarenheit (nFarenheit);
printCelcius ();
}

public void printCelcius ()
{
int f = farenheit;
double a = (f-32)*5;
double b = a/9;

String weather;
if(b > 32 )
{
weather = "It's quite hot, be sure to use sunscreen!";
}
else if (b < 22)
{
weather = "It's a little chilly, wear a sweater!";
}
else
{
weather = "It's nice and cool.";
}


System.out.println ("The temperature in celcius is " + b + " degrees.");

System.out.println ("Forecast: " + weather);

}



}

Anonymous2012-09-11T20:14:51Z

Favorite Answer

Have you tried using the Eclipse IDE? it really helps finding errors or making coding easier at times.

http://www.eclipse.org/downloads/

You can also use ninite and it will automatically install Eclipse along with other software of your choice

http://ninite.com

nivens2017-02-21T09:42:16Z

Why roll your individual whilst there is in all probability a calendar widget you are able to reuse? via the way, the Java API itself supplies many helpful instructions and interfaces: Date, Calendar, GregorianCalendar, DateFormat, and SimpleDateFormat.