
лабораторная работа / лабораторные работы по LAZARUS / Отчет по 2 лазариус
.docxunit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
ExtCtrls, Buttons;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
CheckBox1: TCheckBox;
Edit1: TEdit;
Edit2: TEdit;
Memo1: TMemo;
RadioGroup1: TRadioGroup;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
var
x,fx,y,b,a:extended;
begin
x:=StrToFloat(Edit1.Text);
a:=StrToFloat(Edit2.Text);
b:=StrToFloat(Edit3.Text);
case RadioGroup1.ItemIndex of
0:fx:=0.4343*Ln(x);
1:fx:=Lg(x);
end;
if (1<=x)or (x>=2) then
y:=a*x*x*fx
else
x<1 then y:=fx
else y:=Exp(bx)
end;
initialization
{$I unit1.lrs}
end.