unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
Label3: TLabel;
Edit3: TEdit;
Label4: TLabel;
Edit4: TEdit;
Button1: TButton;
Button2: TButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
katet, gepot, visota, S: real;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var x:real;
begin
if RadioButton1.Checked=true then
begin
katet:=strtofloat(Edit1.Text);
gepot:=sqrt((sqr(katet)+sqr(katet)));
visota:=(gepot/2);
S:=katet*katet/2;
Edit2.Text:=floattostr(gepot);
Edit3.Text:=floattostr(visota);
Edit4.Text:=floattostr(S);
end;
if RadioButton2.Checked=true then
begin
gepot:=strtofloat(Edit2.Text);
visota:=(gepot/2);
katet:=sqrt(sqr(visota)+sqr(gepot/2));
S:=katet*katet/2;
Edit1.Text:=floattostr(katet);
Edit3.Text:=floattostr(visota);
Edit4.Text:=floattostr(S);
end;
if RadioButton3.Checked=true then
begin
visota:=strtofloat(Edit3.Text);
gepot:=2*visota;
katet:=sqrt(sqr(visota)+sqr(gepot/2));
S:=katet*katet/2;
Edit1.Text:=floattostr(katet);
Edit2.Text:=floattostr(gepot);
Edit4.Text:=floattostr(S);
end;
if RadioButton4.Checked=true then
begin
S:=strtofloat(Edit4.Text);
katet:=sqrt(2*S);
gepot:=sqrt(sqr(katet)+sqr(katet));
visota:=(gepot/2);
Edit1.Text:=floattostr(katet);
Edit2.Text:=floattostr(gepot);
Edit3.Text:=floattostr(visota);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Text:='0';
Edit2.Text:='0';
Edit3.Text:='0';
Edit4.Text:='0';
end;
end.