/* Convert and display a temperature, input in degrees Celsius, to a temperature in degrees Fahrenheit. Author: Alan Renaud, CS100 TA Date: 3 July 1999 */ import java.io.*; public class P1_1 { public static void main(String args[]) { double celsius; // temperature in degrees celsius // initialize Text object in to read from standard input. TokenReader in = new TokenReader(System.in); // prompt user for temperature System.out.print("Enter in the temperature in degrees Celsius: "); System.out.flush(); celsius = in.readDouble(); System.out.println(celsius + " degrees Celsius is equal to " + (((9*celsius)/5) + 32) + " degrees Farenheit."); // Wait for user to enter input to ensure console window remains visible in.waitUntilEnter(); } // end main } // end P1_1 /* Sample outputs: ------------------------------------------------------------------ Enter in the temperature in degrees Celsius: -40.0 -40.0 degrees Celsius is equal to -40.0 degrees Farenheit. ------------------------------------------------------------------- Enter in the temperature in degrees Celsius: 35 35.0 degrees Celsius is equal to 95.0 degrees Farenheit. */