Program konversi Java

 import java.io.*;
class conversi {

    public static void main (String[] arg) throws IOException
  {
      int rp,p;
      double g;
    BufferedReader br;
    br =new BufferedReader(new InputStreamReader(System.in));
        System.out.println("Konversi Mata Uang Rupiah");
        System.out.println("1.Dollar");
        System.out.println("2.Yen");
        System.out.println("3.Bath Thailand");
        System.out.println("Masukkan Nilai Rupiah:Rp. ");
        rp =Integer.parseInt(br.readLine());
        System.out.println("Masukkan Pilihan Anda:");
        p =Integer.parseInt(br.readLine());
       
        if(p==1)
        {g =rp/10000;

        System.out.println(g + " USD ");}
        else if(p==2)
        {g =rp/1250;
        System.out.println(g + " Yen ");}
        else if(p==3)
        {g =rp/2500;
        System.out.println(g + " Bath Thailand ");}
        else
        {
        System.out.println("Pilihan yang Anda masukkan salah");}

        }
        }

Output :


Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Bintoro Ali
');