Ad
  • Custom User Avatar

    This kata is bugged and it does not handle rounding properly. The fact that you have problems is not your fault. The kata is wrong.
    If you really want to pass tests, you need to use formula double celsius = (temperature - 32.0) * 5 / 9.0;. But it should not be necessary. It's kata error.

  • Custom User Avatar

    public class GrassHopper {

    public static String weatherInfo(int temp) {
        double c = convertToCelsius(temp);
        if (c > 0)
            return (c + " is above freezing temperature");
        else
            return (c + " is freezing temperature");
    }
    
    public static double convertToCelsius(double temperature) {
        double celsius = (temperature - 32.0) * (5/9.0);
        return celsius;
    }
    

    }

    test5
    expected:<23.33333333333333[2] is above freezing t...> but was:<23.33333333333333[6] is above freezing t...>

    1 HOUR I THINK BUT NOT FIND SOLUTION