Kamis, 15 Maret 2012

Konversi Rupiah ke Mata Uang Asing (Java)

/*
nama file : RupiahkeMataUangAsing.java
programer : elekomfireball.blogspot.com
deskripsi :
 -input Nilai Rupiah
 -tampilkan hasil konversi Rupiah ke 5 Mata Uang Asing
*/
import javax.swing.JOptionPane;
class RupiahkeMataUangAsing 
{
 public static void main(String[] args) 
 {
  String RupiahString;
  Double rupiah;
  Double Dollar;
  Double Poundsterling;
  Double Yen;
  Double Ringgit;
  Double Euro;

  RupiahString = JOptionPane.showInputDialog("Masukkan Nilai Rupiah : ");
  rupiah = Double.parseDouble(RupiahString);

  Dollar = rupiah / 9000;
  Poundsterling = rupiah / 15000;
  Ringgit = rupiah / 2000;
  Euro = rupiah / 12000;
  Yen = rupiah / 1400;
  JOptionPane.showMessageDialog(null,"Dollar : \n" + Dollar +"\n"+"Poundsterling : \n" + Poundsterling +"\n" +"Ringgit : \n"+ Ringgit +"\n" + "Euro : \n"+Euro +"\n" +"Yen : \n"+Yen);
 }
}

Tidak ada komentar:

Posting Komentar