unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, Math;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Memo1: TMemo;
    Button1: TButton;
    Button2: TButton;
    Edit3: TEdit;
    Edit4: TEdit;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.Text:='0,1' ;
Edit2.Text:='0,7'  ;
Edit3.Text:='0,1'  ;
Edit4.Text:='0,0001'  ;
Memo1.Clear;
Memo1.Lines.Add('Лаб. раб. №3 020602 Сенкевич А.В.') ;
end;

procedure TForm1.Button1Click(Sender: TObject);
var xn,xk,x,h,e,a,s,y: extended;
    n: integer;
begin
xn:=StrToFloat(Edit1.Text);
Memo1.Lines.Add('xn='+FloatToStrF(xn,fffixed,6,2));
xk:=StrToFloat(Edit2.Text);
Memo1.Lines.Add('xk='+FloatToStrF(xk,fffixed,6,2));
h:=StrToFloat(Edit3.Text);
Memo1.Lines.Add('h='+FloatToStrF(h,fffixed,8,3));
e:=StrToFloat(Edit4.Text);
Memo1.Lines.Add('e='+FloatToStrF(e,fffixed,8,5));
x:=xn;
repeat
 a:=1; S:=1; n:=0;
  while(abs(a)>e) do begin
   n:=n+1;
    a:=a*(2*x)/n;
    s:=s+a;
   end;
    y:=exp(2*x);
 Memo1.Lines.Add('при x='+FloatToStrF(x,fffixed,6,2)+' сумма='
                  + FloatToStrF(s,fffixed,8,4)+ ' y='
                  + FloatToStrF(y,fffixed,8,4)+ ' N='+IntToStr(n));
  x:=x+h;
 until x>(xk+h/2)
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
print;
end;

end.
