All pastes #732725 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-10-11 06:28 UTC
rendered paste body
import javax.swing.JOptionPane;
import java.io.*;
import java.util.*;

public class DriceFartoCels {
	
	/**
	 * Method main
	 *
	 *
	 * @param args
	 *
	 */
	public static void main(String[] args) 
				throws FileNotFoundException
				{
		
		String FarString, Outputstr;
		double Far, Cels, Result, txt, Result2;
		
		FarString = JOptionPane.showInputDialog("Enter Your Fahrenheit:");
		Far = Double.parseDouble(FarString);
		
		
			
		Scanner inFile = new Scanner(new FileReader("infile.txt"));
		txt = inFile.nextDouble();
		
		Cels = (5.0/9)*(Far - 32);
		Result =  Cels;
		Result2 = (5.0/9)*(txt - 32);
		Outputstr = "your f-c is:" + String.format("%.2f", Result);
		JOptionPane.showMessageDialog(null, Outputstr);
		
		System.out.printf("%.2f",  Result);
		System.out.printf("\nText File Far Is:" + "%.2f", Result2);
		
		PrintWriter outFile = new PrintWriter("Results.txt");
		outFile.println(Result);
		outFile.close();	
	
	
	}	
}