Build is good but run it will not.
Using NetBeans IDE 7.4.
Code:
import java.util.Scanner;
public class FahrenheitOrCelsius
{
public void FdegreeOrCdegree ()
{
{Scanner input = new Scanner( System.in );
int conversionType;
do
{
System.out.println("1. Fahrenheit to Celsius");
System.out.println("2. Celsius to Fahrenheit");
System.out.println("3. None");
System.out.println("Conversion Type: ");
conversionType = input.nextInt();
if (conversionType != 3)
{
System.out.print( "Enter Temperature to Convert: ");
int convertTemperature = input.nextInt();
switch ( conversionType )
{
case 1:
System.out.printf( "%d Fahrenheit is %d Celsius\n",
convertTemperature, celsius( convertTemperature ) );
break;
case 2:
System.out.printf( "%d Celsius is %d Fahrenheit\n",
convertTemperature, fahrenheit( convertTemperature ) );
break;
}
}
} while ( conversionType != 3 );
}
}
public int celsius( int fahrenheitTemperature )
{
return ( (int) ( 5.0 / 9.0 * ( fahrenheitTemperature - 32 ) ) );
}
public int fahrenheit( int celsiusTemperature )
{
return ( (int) ( 9.0 / 5.0 * celsiusTemperature + 32 ) );
}
}
It is probably something simple and I am thinking to hard...