//===================================================================
// Conversion between Fahrenheit and Celsius 
//===================================================================
public class convert2 
{
    public static void main(String[] arguments) 
    {

        float fah = 87.3F;                      // notice the F     
        float fah2cel;

        System.out.println();                   // print empty line;

        System.out.println(fah + "\t  degrees Fahrenheit is ...");

                                                // To convert Fahrenheit into Celsius
        fah2cel = fah - 32;                     // subtract 32
        fah2cel = fah2cel * 5/9;                // then multiply by 5 divided by 9
        
        System.out.println(fah2cel + " degrees Celsius");

        fah2cel = Math.round(fah2cel * 100);    // multiply by 100 and round 
        fah2cel = fah2cel / 100;                // divide by 100    

        System.out.println(fah2cel + "\t  rounded to 2 dec places \n");

        //-------- Celsius to Fahrenheit ---------------------------------------------

        float cel = 32.12F;         
        float cel2fah;
         
        System.out.println(cel + "\t  degrees Celsius is ...");

                                                // To convert Celsius into Fahrenheit
        cel2fah = cel * 9/5 + 32;               // multiply by 9/5 then add 32
                                                // all on 1 line

        System.out.println(cel2fah + " degrees Fahrenheit");

        cel2fah = (float) Math.round(cel2fah * 100) / 100;  //casting, otherwise
                                                            //integer division

        System.out.println(cel2fah + "\t  rounded to 2 dec places \n");
    }
}