unit Shapes;

interface

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

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

var
  Form1: TForm1;

implementation

{$R *.dfm}

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

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
if(RadioButton1.Checked) and (Edit1.Text='S=a*a') then Label2.Caption:='Молодец';
if (edit1.text<>'S=a*a')and (RadioButton1.Checked) then Label2.Caption:='no S=a*a';
if(RadioButton3.Checked) and (Edit1.Text='S=a*b') then Label2.Caption:='Молодец';
if (edit1.text<>'S=a*b') and (RadioButton3.Checked) then Label2.Caption:='no S=a*b';
if(RadioButton2.Checked) and (Edit1.Text='S=pi*r^2') then Label2.Caption:='Молодец';
if (edit1.text<>'S=pi*r^2')and (RadioButton2.Checked) then Label2.Caption:='no S=pi*r^2';

end;

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

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

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

end.
