Добавил:
Xer1t
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
chk1: TCheckBox;
rb1: TRadioButton;
rb2: TRadioButton;
lst1: TListBox;
btn1: TButton;
l1: TLabel;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btn1Click(Sender: TObject);
var n:Integer; st:real;
begin
n:=lst1.ItemIndex;
case n of
0: st:=100;
1,2: st:=200;
3..5: st :=400;
else
begin
st:=0;
ShowMessage('Не выбран город');
end;
end;
if rb1.Checked then st :=st*1.25 else
if rb2.Checked then st:=st*0.75;
if chk1.Checked then st:=st*2;
l1.Caption:=FloatToStr(st) + ' рублей.';
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
chk1: TCheckBox;
rb1: TRadioButton;
rb2: TRadioButton;
lst1: TListBox;
btn1: TButton;
l1: TLabel;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btn1Click(Sender: TObject);
var n:Integer; st:real;
begin
n:=lst1.ItemIndex;
case n of
0: st:=100;
1,2: st:=200;
3..5: st :=400;
else
begin
st:=0;
ShowMessage('Не выбран город');
end;
end;
if rb1.Checked then st :=st*1.25 else
if rb2.Checked then st:=st*0.75;
if chk1.Checked then st:=st*2;
l1.Caption:=FloatToStr(st) + ' рублей.';
end;
end.