import java.io.PrintStream;
import java.io.FileOutputStream;
import java.io.IOException;
class FahrToCelsius {
public static void main (String args[]) {
double fahr, celsius;
double lower, upper, step;
lower = 0.0; // lower limit of temperature table
upper = 300.0; // upper limit of temperature table
step = 20.0; // step size
fahr = lower;
try {
FileOutputStream fout = new
FileOutputStream("test.out");
// now chain the FileOutputStream to a PrintStream
PrintStream myOutput = new PrintStream(fout);
while (fahr <= upper) { // while loop begins here
celsius = 5.0 * (fahr-32.0) / 9.0;
myOutput.println(fahr + " " + celsius);
fahr = fahr + step;
} // while loop ends here
} // try ends here
catch (IOException e) {
System.err.println("Error: " + e);
System.exit(1);
}
} // main ends here
}