FileDocCategorySizeDatePackage
TempConverter.javaAPI DocExample823Tue Feb 28 11:34:06 GMT 2006com.ora.jsp.util

TempConverter

public class TempConverter extends Object
This class contains a couple of static methods for converting between Fahrenheit and Celsius. The methods are mapped to el functions in the book examples TLD file.
author
Hans Bergsten, Gefion software
version
1.0

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)
Main method to test the other methods.

        System.out.println("20 C is " + toFahrenheit(20) + " F");
        System.out.println("68 F is " + toCelsius(68) + " C");
    
public static doubletoCelsius(double fahrenheit)

        return (fahrenheit - 32) * 5 / 9;
    
public static doubletoFahrenheit(double celsius)

        return celsius * 9 / 5 + 32;