unit Unit9;

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;
    BitBtn3: TBitBtn;
    procedure FormCreate(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn3Click(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 NameFun:='функция 9';Tabl(Function9,xn,xk,h);end;
    1:begin NameFun:='функция 10';Tabl(Function10,xn,xk,h);end;
  end;
end;

procedure TForm1.BitBtn3Click(Sender: TObject);
begin
Memo1.Clear; 
end;

end.
