package demo3; /** * Muunnoksia * * @author Kalle Aavikko 25.9.2009 */ public class Muunnoksia2 { /** * Ohjelma muuntaa Fahrenheitasteet * Celsius-asteiksi ja paunat grammoiksi. * @param fahrenheit muunnettava F lämpötila * @return annetun F lämpötilan Celcius-asteina */ public static double fahrenheitToCelsius(double fahrenheit) { double celsius = (fahrenheit - 32) * 5.0 / 9.0; return celsius; } /** * Muuttaa... * * @param pound * @return muunne... */ public static double poundToGram(double pound) { double gram = (pound * 453.59237); return gram; } /** * Tehdään muunnoksia * * @param args * ei käytössä */ public static void main(String[] args) { double lampotilaC; lampotilaC = fahrenheitToCelsius(13); System.out.println(lampotilaC + " celsiusastetta"); double gramG; gramG = poundToGram(1); System.out.println(gramG + " grammaa"); } }