FToCDialog - p public void run() {...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * 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.*; i public class FToCDialog extends DialogProgram {
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: p 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 + "."); } }...
View Full Document

Ask a homework question - tutors are online