import java.awt.Graphics; 
import java.applet.Applet; 

public class H3AL9 extends Applet 
{ 
// void tipi paint metodu 
public void paint( Graphics g) 
{
int x1=7;
double x2=7.0; 
g.drawString(" exp ("+x1+")  (int metod girdisi ) = "+exp(x1),25,25); 
g.drawString(" exp ("+x2+")  (double metod girdisi) = "+exp(x2),25,40); 
} 
// double girisli exp metodu 
public double exp(double x) 
    { 
        double faktoriyel=1; 
        double us=1; 
        double exponent=1; 
        for(double i=1;i<=300;i++) 
        { 
          faktoriyel*=i; 
          us*=x; 
          exponent+=us/faktoriyel; 
        } 
    return exponent;
    } 
// int girişli exp metodu
public double exp(int x) 
    { 
        double exponent=1.0; 
        for(int i=1;i<=x;i++) 
        { 
          exponent*=Math.E;  
        } 
    return exponent;
    } 
} 

