/* * File: FToCDialog.java * --------------------- * This program reads in the temperature in degrees Fahrenheit * and prints the corresponding temperature in degrees Celsius * using dialog boxes. * * Author: CS1MD3, Sept. 2008 */ import acm.program.*; public class FToCDialog extends DialogProgram { 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 + "."); } }