import javax.swing.JOptionPane;
import java.util.Locale;

public class booleanex3
{
     // main method begins execution of Java application
     public static void main( String args[] )
     {  Locale us=new Locale("US");  
        char d='\u0394';
        char o='\u00B0';        
        double T1;
        double T2; //   
        double dT; // sum of number1 and number2
        String a1="Enter first temperature "+'\u000B'+"C : "; 
        T1 = Double.parseDouble(JOptionPane.showInputDialog(a1));
        String a2="Enter second temperature "+'\u000B'+"C : "; 
        T2 = Double.parseDouble(JOptionPane.showInputDialog(a2));
        dT = T1 - T2; // difference of temperatures
        boolean b0=(dT<0);
        boolean b1=(dT>=0) && (dT<10);
        boolean b2=(dT>=10) && (dT<20);
        boolean b3=(dT>=20) && (dT<30);
        boolean b4=(dT>=30); 
        String s1="T1 = %4.1f"+o+"C \n";
        s1+="T1 = %4.1f"+o+"C \n";
        s1+=d+"T = %4.1f"+o+"C \n";
        s1+= d+"T smaller than 0 = "+b0+"\n";
        s1+= d+"T between 0 and 10 = "+b1+"\n";
        s1+= d+"T between 10 and 20 = "+b2+"\n";
        s1+= d+"T between 20 and 30 = "+b3+"\n";
        s1+= d+"T bigger than  30 = "+b4+"\n";
        String s4=String.format(us,s1,T1,T2,dT );
        JOptionPane.showMessageDialog(null,s4); // display sum
     } // end method main

} // end class BPIH1E4
