unit unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
nim: TEdit;
kelas: TEdit;
Label5: TLabel;
Edit1: TEdit;
nama: TEdit;
Label6: TLabel;
cbox1: TComboBox;
Label7: TLabel;
cbox2: TComboBox;
jdbgie: TLabel;
Edit4: TEdit;
GroupBox1: TGroupBox;
rb1: TRadioButton;
rb2: TRadioButton;
GroupBox2: TGroupBox;
cb1: TCheckBox;
cb2: TCheckBox;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure cbox1Click(Sender: TObject);
procedure rb1Click(Sender: TObject);
procedure rb2Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure hitung;
end;
var
Form1: TForm1;
hrg,a,b,harga: real;
implementation
procedure tform1.hitung;
begin
harga:=hrg+a+b;
edit4.text:=floattostr(harga);
end;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
cbox1.Items.Add('Jeans');
cbox1.Items.Add('Katun');
cbox1.Items.Add('Sutra');
cbox1.Items.Add('Bahan');
cbox2.Items.Add('XL');
cbox2.Items.Add('L');
cbox2.Items.Add('M');
cbox2.Items.Add('S');
nama.Text:=('Desi suprihatin);
nim.Text:=('12094541');
kelas.text:=('12.4H.03');
edit1.SetFocus;
end;
procedure TForm1.cbox1Click(Sender: TObject);
begin
if cbox1.Text='Jeans' then
hrg:=100000
else if cbox1.Text='Katun' then
hrg:=75000
else if cbox1.Text='Sutra' then
hrg:=150000
else
hrg:=50000
end;
procedure TForm1.rb1Click(Sender: TObject);
begin
if rb1.checked=true then
a:=hrg*1
else
a:=0;
hitung;
end;
procedure TForm1.rb2Click(Sender: TObject);
begin
if rb2.checked=true then
b:=hrg*0.5
else
b:=0;
hitung;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
end.
Tidak ada komentar:
Posting Komentar