/**
* Two utility methods related to temperature.
*
* @author CS159 Faculty
* @version 01/24/2024
*/
public class Temperature {
/**
* Reports whether temperature is Low, Medium, or High.
*
* @param temp the temperature to categorize
* @return "Low", "Medium", or "High"
*/
public static String report(int temp) {
if (temp >= 80) {
return "High";
}
if (temp >= 65) {
return "Medium";
}
return "Low";
}
/**
* Computes the average of three temperatures.
*
* @param val1 first temperature value
* @param val2 second temperature value
* @param val3 third temperature value
* @return the average temperature
*/
public static double average(double val1, double val2, double val3) {
return (val1 + val2 + val3) / 3.0;
}
}