unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    edt1: TEdit;
    edt2: TEdit;
    edt3: TEdit;
    edt4: TEdit;
    lbl1: TLabel;
    lbl2: TLabel;
    lbl3: TLabel;
    lbl4: TLabel;
    lbl5: TLabel;
    mmo1: TMemo;
    btn1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure btn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
edt1.Text:='0,1';
 edt2.Text:='0,7';
  edt3.Text:='0,001';
   edt4.Text:='0,0001';
end;

procedure TForm1.btn1Click(Sender: TObject);
  var xn,xk,x,h,e,a,s,y :extended;
     n,k:integer;
begin
   Mmo1.Clear;
   Mmo1.Lines.Add('Результаты ст. гр. 552002 Петрова И.В.');
     xn:=StrToFloat(Edt1.Text);
Mmo1.Lines.Add(' xn='+FloatToStrF(xn,ffFixed,6,2));
     xk:=StrToFloat(Edt2.Text);
 Mmo1.Lines.Add(' xk='+FloatToStrF(xk,ffFixed,6,2));
     h:=StrToFloat(Edt3.Text);
Mmo1.Lines.Add(' h='+FloatToStrF(h,ffFixed,8,3));
     e:=StrToFloat(Edt4.Text);
Mmo1.Lines.Add(' e='+FloatToStrF(e,ffFixed,8,5));
         x:=xn;
  repeat
      a:=x;  S:=x;  n:=0;
         while (abs(a) > e) do begin
            n:=n+1;
              a:=((-a)*x*x)/(2*n*(2*n+1));
              s:=s+a;
           end;
              y:=sin(x);
     Mmo1.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;

end.
