Class TemperatureConversion

java.lang.Object
  extended by TemperatureConversion

public class TemperatureConversion
extends java.lang.Object

The TemperatureConversion Java application prints a table converting Celsius to Fahrenheit degrees.

See Also:
Java Source Code (www.cs.colorado.edu/~main/applications/TemperatureConversion.java)

Constructor Summary
TemperatureConversion()
           
 
Method Summary
static double celsiusToFahrenheit(double c)
          Convert a temperature from Celsius degrees to Fahrenheit degrees.
static void main(java.lang.String[] args)
          The main method prints a Celsius to Fahrenheit conversion table.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemperatureConversion

public TemperatureConversion()
Method Detail

main

public static void main(java.lang.String[] args)
The main method prints a Celsius to Fahrenheit conversion table. The bounds of the table range from -50C to +50C in 10 degree increments. The String argumments (args) are not used in this implementation.


celsiusToFahrenheit

public static double celsiusToFahrenheit(double c)
Convert a temperature from Celsius degrees to Fahrenheit degrees.

Parameters:
c - a temperature in Celsius degrees
Precondition:
c >= -273.16.
Returns:
the temperature c converted to Fahrenheit
Throws:
java.lang.IllegalArgumentException - Indicates that c is less than the smallest Celsius temperature (-273.16).