import javax.swing.*;

public class H2YOEx6
{
public  double exp(double x)
{
//exponensiyeli hesaplayan (dinamik) metod	
// e^x = 1+x/1!+x^2/2!+x^3/3!+x^4/4!+ ..
// not : e=2.7182818
double faktoriyel=1;
double us=1;
double exponent=1;
double sayi=1;
while(sayi<=200)
{
faktoriyel*=sayi;
us*=x;
exponent+=us/faktoriyel;
sayi++;
}
return exponent;
}

public double kare(double x)
{
//kareyi hesaplayan (dinamik metod)
return x*x;
}
}