import javax.swing.*; // program poweres class Scanner

public class BPIH4E8B
{
     // main method begins execution of Java application
     public static void main( String args[] )
     {            
        // number e = 2.718...
        // exp(x) = 1 + x /1! + x2 / 2! + x3 / 3! + x4 / 4! + ..
        String s; 
        double x=Double.parseDouble(JOptionPane.showInputDialog("Enter a real number: ")); // read number
        double power=1;
        double exponent=1;
        double factorial=1;
        for(double sayi=1;sayi<=200;sayi++)
        {
        factorial*=sayi;
        power*=x;
        exponent+=power/factorial;
        }
        s="exp("+x+") = "+exponent;
        JOptionPane.showMessageDialog(null,s,"exponent calculation",JOptionPane.PLAIN_MESSAGE);
     } // end method main
} // end class BPIH4E1
