Modify a text file: $/F2C.java
$/F2C.java
/** Convert Celsius to Fahrenheit (Liang p.69) @author: B.A.Martin **/ import java.util.Scanner; public class C2F { public static void main( String args[] ) { // 0. SETUP: Declare variables for data and result. double tempF, tempC; Scanner in = new Scanner(System.in); // Prepare to read. // 1. INPUT: Get temp.in F System.out.print( "Enter the Fahrenheit temperature: " ); tempF = in.nextDouble(); // 2. PROCESS: Convert to C tempC = (9 / 5) * ( tempF + 32 ); // 3. OUTPUT: Show the answer. System.out.println( "Celsius temperature is " + tempC ); } }