SELAMAT DATANG DI BLOG SAYA .... SELAMAT DATANG DI BLOG SAYA ...SELAMAT DATANG DI BLOG SAYA

Rabu, 23 November 2011

Program Java Menghitung Nilai Temperatur /Suhu

/*

            file name : Menghitung Nilai Temperatur /Suhu
            programer : Andes Arinal G
            deskripsi :    Dengan Menginput bilangannya 
*/



import javax .swing.JOptionPane;
class Temperatur 
    { 

    public static void main (String args[]) 
    { 
        
        String celciusS, rheamurS,fahrenheitS;

        celciusS = JOptionPane.showInputDialog(" Masukan Nilai Celcius :  ");
        double celcius = Double.parseDouble(celciusS);
        rheamurS = JOptionPane.showInputDialog(" Masukan Nilai Reamur :  ");
        double rheamur = Double.parseDouble(rheamurS);
        fahrenheitS = JOptionPane.showInputDialog(" Masukan Nilai Fahrenheit :  ");
        double  fahrenheit = Double.parseDouble(fahrenheitS);

        //int kelvin;
        double celcius1,farenheit1,kelvin,Hrheamur,Hcelcius,Hfahrenheit,farenhei1t ;
        //double andes = 273.15;
        farenheit1=1;
        
                kelvin = celcius+273.15 ;        //    A. Rumus merubah celcius ke kelvin
                Hrheamur = celcius * 0.8; //    B. Rumus merubah celcius ke rheamur
                Hcelcius    = rheamur * 1.25;    //    C. Rumus merubah reamur ke celcius
                Hfahrenheit = (celcius * 1.8) + 32;    //    D. Rumus merubah celcius ke fahrenheit
                celcius1    = (fahrenheit-32) / 1.8;    //    E. Rumus merubah fahrenheit ke celcius
                farenhei1t= (rheamur * 2.25) + 32;    //    F. Rumus merubah rheamur ke farenheit

            System.out.print(" Celcius Ke Kelvin  : "+kelvin);
            System.out.print("\n Celcius ke Rheamur  : "+Hrheamur);
            System.out.print("\n reamur ke celcius  : "+Hcelcius);
            System.out.print("\n celcius ke fahrenheit : "+Hfahrenheit);
            System.out.print("\n fahrenheit ke celcius : "+celcius1);
            System.out.print(" \n rheamur ke farenheit  : "+farenheit1);
            System.out.print(" \n\n");
                                
                    
                        
                        
    } 

}

HASIL PROGRAMNYA :


GOOD LUCK ....

Tidak ada komentar:

Posting Komentar

Anda bisa berlangganan FEED via email
ads