Warung Bebas

Senin, 10 September 2012

Konverter Celcius-farenheit | Celcius - Reamur dengan Java

import javax.swing.*;
class konverter
{
public static void main(String args[])throws Exception
{

//deklarasi variabel
int ce;

String celcius = "";
celcius=JOptionPane.showInputDialog("Masukan Nilai Celcius");

ce = Integer.parseInt(celcius);
int fa = ce * 9 / 5 + 32;
int re = ce * 4 / 5;

JOptionPane.showMessageDialog(null,"\nHasil Konversi " + "\nHasil derajat fahrenheit ="+ fa + "\nHasil derajat reamur= "+ re);
}
}


Hasil tampilan sebagai berikut : .....


0 komentar em “Konverter Celcius-farenheit | Celcius - Reamur dengan Java”

Posting Komentar

 

M-Kolom Tutorial | All Tutorial Copyright © 2012 Fast Loading -- Powered by Blogger