Aqui teneis un codigo que acabo de desarrollar:
import java.io.*;
public class CelsiusKelvinViceversa {
public static void main
(String args
[]) { try
{
System.
out.
println("Bienvenido a Celsius To Kelvin y viceversa by Erik"); System.
out.
println("Que deseas hacer: "); System.
out.
println("1.Celsius to Kelvins"); System.
out.
print("2.Kelvins to Celsius: "); int opc
= Integer.
parseInt(br.
readLine()); if(opc==1){
System.
out.
print("Introduce los Celsius a convertir: "); double g
= Double.
parseDouble(br.
readLine()); double ck = g + 273.15;
System.
out.
println("Celsius To Kelvin: " + ck
); }
if(opc==2){
System.
out.
print("Introduce los Kelvins a convertir: "); double g
= Double.
parseDouble(br.
readLine()); double kc = g - 273.15;
System.
out.
println("Kelvin To Celsius: " + kc
); }
}
{
exp.printStackTrace();
}
}
}