unit Perimetr;

interface

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

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    Shape1: TShape;
    GroupBox1: TGroupBox;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    procedure BitBtn2Click(Sender: TObject);
    procedure RadioButton1Click(Sender: TObject);
    procedure RadioButton2Click(Sender: TObject);
    procedure RadioButton3Click(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.BitBtn2Click(Sender: TObject);
begin
close;
end;

procedure TForm1.RadioButton1Click(Sender: TObject);
begin
Shape1.Shape:=stSquare;
end;

procedure TForm1.RadioButton2Click(Sender: TObject);
begin
Shape1.Shape:=stRectangle;
end;

procedure TForm1.RadioButton3Click(Sender: TObject);
begin
Shape1.Shape:=stCircle;
end;

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
if(RadioButton1.Checked)and(Edit1.Text='P=4*a')then Label2.Caption:='Молодец';
if (radiobutton1.Checked) and (edit1.text<>'P=4*a') then Label2.Caption:='Неправильно';
if(RadioButton2.Checked)and(Edit1.Text='P=2*(a+b)')then Label2.Caption:='Молодец';
if (radiobutton2.checked) and (edit1.text<>'P=2*(a+b)') then Label2.Caption:='Неправильно';
if(RadioButton3.Checked)and(Edit1.Text='P=2pi*R')then Label2.Caption:='Молодец';
if(RadioButton3.Checked)and(Edit1.Text<>'P=2pi*R')then Label2.Caption:='Неправильно';

end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  edit1.Text:='';
end;

end.
