You are on page 1of 1

/* * To change this template, choose Tools | Templates * and open the template in the editor.

*/ package cfconversion; import java.io.*; import java.text.DecimalFormat; import java.text.NumberFormat; /** * * @author Joann G */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { BufferedReader X = new BufferedReader (new InputStreamReader (System.in)); double Xcel=0; double Xfah=0; System.out.print("Enter Celcius: "); Xcel=Double.parseDouble(X.readLine()); Xfah= (Xcel * 9/5) + 32; NumberFormat formatter= new DecimalFormat("#0.00"); System.out.println("\t\tFahrenheit: " + formatter.format(Xfah)+"\n\n ") ;

double fahx=0; double celx=0; System.out.print("Enter Fahrenheit: "); fahx=Double.parseDouble(X.readLine()); celx= (fahx-32) * 5/9; NumberFormat formatter1= new DecimalFormat("#0.00"); System.out.println("\t\tFahrenheit: " +formatter1.format(celx) + "\n\n ") ; } }

You might also like