are you allowed to use JOptionPane ? if yes then:
import java.util.*;
public class TempConversion
{
public static void main(String[] args)
{
double result;
String degree;
int input;
degree = JOptionPane.showInputDialog("Enter: \n C - Fahrenheit to Celsius\n F - Celsius to Fahrenheit");
input = new Integer(JOptionPane.showInputDialog("Enter the degree:")).intValue();
if(degree == "C" || degree == "c")
{
result = 5.0/9.0 * (input - 32);
System.out.println(input + " Fahrenheit is " + result + " Celsius");
}
else if(degree == "F" || degree == "f")
{
result = 9.0/5.0 * input + 32;
System.out.println(input + " Celsius is " + result + " Fahrenheit");
}
}
}