/* * File: FahrenheiToCelsius.java * ----------------------------- * This program reads in the temperature in degrees Fahrenheit * and prints the corresponding temperature in degrees Celsius * * Author: CS1MD3, Sept. 2008 */ import acm.program.*; public class FahrenheitToCelsius extends ConsoleProgram { public void run() { println("This program converts Fahrenheit to Celsius."); double f = readDouble("Enter Fahrenheit temperature: "); /* convert Fahrenheit to Celsius */ double c = (5 * (f - 32)) / 9; println("Celsius equivalent = " + c + "."); } }