// Convert a Celsius temperature c to Fahrenheit degrees
public static double celsiusToFahrenheit(double c)
double fahrenheit = celsiusToFahrenheit(celsius);
celsiusToFahrenheit
public static double celsiusToFahrenheit(double c)
Convert a temperature from Celsius degress to Fahrenheit degrees.
Parameters:
c - a temperature in Celsius degrees
Precondition:
c >= -273.15.
Returns:
the temperature c converted to Fahrenheit degrees
Throws: IllegalArgumentException
Indicates that c is less than the smallest Celsius temperature (-273.15).
AssertionError
by your program if the expression is false.
java -ea TemperatureConversion
throw
instead.