← all problems

WeatherDesk.describeTemperature 🌶️🌶️

Below is a partially written WeatherDesk class. It already has two overloaded versions of classify: one that takes an int (a whole-degree reading) and one that takes a double (a precise reading) — Java picks the right one automatically based on each argument's type. Write the describeTemperature method: call classify on wholeTemp and print what it returns, then call classify on preciseTemp and print what THAT returns — two lines total. For example, describeTemperature(72, 71.5) should print:

whole-degree reading: 72
precise reading: 71.5

WeatherDesk.java — the class below is already written; you're only completing the method in the editable box.

class WeatherDesk {
    public static String classify(int wholeDegrees) {
        return "whole-degree reading: " + wholeDegrees;
    }

    public static String classify(double preciseDegrees) {
        return "precise reading: " + preciseDegrees;
    }
    // ---- write your method below ----
}