Saturday, 27 August 2016

Java Program

GUI Based Currency Converter Java Program


import javax.swing.JOptionPane;
    class converter{
        public static void main(String[]args) throws Exception{
            String amount = JOptionPane.showInputDialog("Enter rupees");
            int asd = Integer.parseInt(amount);
        
        float us_dollor = asd / 104f;
        float aus_dollor = asd / 78f;
        float riyal = asd / 28f;
        float deenar = asd / 358f;
            JOptionPane.showMessageDialog(null, "Pakistani Rupees" + asd + 
                        "\n In US Dollors: " + us_dollor + 
                        "\n Australian Dollors : " + aus_dollor +
                        "\n Saudi Riyal : " + riyal +
                        "\n Deenar : " + deenar );
        }
    }

No comments:

Post a Comment