unit dewi;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Timer1: TTimer;
Label4: TLabel;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
Label5: TLabel;
harga: TEdit;
GroupBox1: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
GroupBox2: TGroupBox;
Label6: TLabel;
eharga: TEdit;
ComboBox1: TComboBox;
Label7: TLabel;
Label8: TLabel;
diskon: TEdit;
Label9: TLabel;
total: TEdit;
proses: TButton;
lagi: TButton;
keluar: TButton;
Label10: TLabel;
ComboBox2: TComboBox;
Label11: TLabel;
ComboBox3: TComboBox;
procedure Timer1Timer(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure CheckBox2Click(Sender: TObject);
procedure CheckBox3Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure RadioButton3Click(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure keluarClick(Sender: TObject);
procedure lagiClick(Sender: TObject);
procedure prosesClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
a,b,d,e,f:real;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
label4.Caption :=formatdatetime('dddd/dd/mmmm/yyyy',now)
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
if checkbox1.Checked =true then
d:=50000
else
d:=0;
harga.Text :=floattostr(d+e+f)
end;
procedure TForm1.CheckBox2Click(Sender: TObject);
begin
if checkbox2.Checked =true then
e:=50000
else
e:=0;
harga.Text :=floattostr(d+e+f)
end;
procedure TForm1.CheckBox3Click(Sender: TObject);
begin
if checkbox3.Checked =true then
f:=50000
else
f:=0;
harga.Text :=floattostr(d+e+f)
end;
procedure TForm1.RadioButton1Click(Sender: TObject);
begin
if radiobutton1.Checked = true then
eharga.Text :='100000'
else
eharga.Text :='0'
end;
procedure TForm1.RadioButton2Click(Sender: TObject);
begin
if radiobutton2.Checked = true then
eharga.Text :='200000'
else
eharga.Text :='0'
end;
procedure TForm1.RadioButton3Click(Sender: TObject);
begin
if radiobutton3.Checked = true then
eharga.Text :='150000'
else
eharga.Text :='0'
end;
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
if combobox1.Text ='vip'then
begin
a:=strtofloat(eharga.Text);
b:=a*0.15 ;
diskon.Text :=floattostr(b) ;
end
else
if combobox1.Text ='gold'then
begin
a:=strtofloat(eharga.Text);
b:=a*0.10 ;
diskon.Text :=floattostr(b) ;
end
else
diskon.Text :='0' ;
end;
procedure TForm1.keluarClick(Sender: TObject);
begin
close;
end;
procedure TForm1.lagiClick(Sender: TObject);
begin
checkbox1.Checked :=false;
checkbox2.Checked :=false;
checkbox3.Checked :=false;
radiobutton1.Checked :=false;
radiobutton2.Checked :=false;
radiobutton3.Checked :=false;
harga.Text :='0';
eharga.Text :='0';
total.Text :='0';
diskon.Text :='0';
combobox1.Text :='';
combobox2.Text :='';
combobox3.Text :='';
end;
procedure TForm1.prosesClick(Sender: TObject);
begin
total.Text :=floattostr((strtofloat(harga.Text)+strtofloat(eharga.Text))-strtofloat(diskon.Text))
end;
end.
Tidak ada komentar:
Posting Komentar