unit Unit7910;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons, ExtCtrls,MatFun;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    RadioGroup1: TRadioGroup;
    Memo1: TMemo;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    procedure FormCreate(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
Type
  fun=function(x:extended):extended;
var
  N:extended;NameFun:string;
var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
 Edit1.Text:='0,1';
 Edit2.Text:='1';
 Memo1.Clear;
 RadioGroup1.ItemIndex:=0;
end;

procedure Tabl(f:fun;xn,xk,h:extended);//расчет таблицы
 var x,y:extended;
begin
 x:=xn;
 Form1.Memo1.Lines.Add(NameFun);
  Repeat
   y:=f(x);
Form1.Memo1.Lines.Add('x='+FloatToStrf(x,fffixed,10,6)+'   y='+FloatToStrf(y,fffixed,10,6));
x:=x+h;
  until (x>xk);
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
//ввод данных
var xn,xk,h:extended;
begin
 xn:=StrToFloat(Edit1.Text);
 xk:=StrToFloat(Edit2.Text);
 h:=(xk-xn)/10;
  case RadioGroup1.ItemIndex of
    0:begin Tabl(Funct,xn,xk,h);NameFun:='функция';end;
    1:begin Tabl(Ryad,xn,xk,h);NameFun:='разложение';end;
  end;
end;

end.
