Im having some trouble finishing this program if anyone could help that would be great

You have a wrong couples of {}. There is one ending } missing in the end of your public static double k2c(double kelvin) method. It’s maybe a typo and there is no syntax error in your code but please fix it anyway.


Another mistake is while printing a new line. You have to use \n (not %n as you have used). So your code should look like this:

System.out.printf("%.2f F => %.2f C\n", 32.0, f2c(32.0));
System.out.printf("%.2f F => %.2f C\n", 212.0, f2c(212.0));
System.out.printf("%.2f C => %.2f F\n", 0.0, c2f(0.0));
System.out.printf("%.2f C => %.2f F\n", 100.0, c2f(100.0));

Leave a Comment