unit Unitjual;
interface
uses
Windows, Messages, SysUtils, Variants,
Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;
type
TForm1 = class(TForm)
Ed1: TEdit;
Ed2: TEdit;
Ed_hasil: TEdit;
Button1: TButton;
Button2: TButton;
Image1: TImage;
Label4: TLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label5: TLabel;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Button3: TButton;
Label6: TLabel;
ComboBox1: TComboBox;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure RadioButton1Click(Sender:
TObject);
procedure RadioButton2Click(Sender:
TObject);
procedure ComboBox1Change(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
a,b,c:Real; //
variabel global
implementation
{$R *.dfm}
procedure
TForm1.Button1Click(Sender: TObject);
begin
ed1.Clear;
ed2.Clear;
ed_hasil.Clear;
ed1.SetFocus;
combobox1.text:='PILIHAN
BARANG :';
end;
procedure
TForm1.Button3Click(Sender: TObject);
begin
a:=strtofloat(ed1.Text);
b:=strtofloat(ed2.Text);
c:=a*b;
if
radiobutton1.checked = true then
c:=c-(c*0.2);
ed_hasil.Text:=floattostr(c)
end;
procedure
TForm1.Button2Click(Sender: TObject);
begin
close;
end;
procedure
TForm1.RadioButton1Click(Sender: TObject);
begin
if
radiobutton1.Checked = true then
ed_hasil.Text:=floattostr(c)
end;
procedure
TForm1.RadioButton2Click(Sender: TObject);
begin
if
radiobutton2.Checked = true then
ed_hasil.Text:=floattostr(c)
end;
procedure
TForm1.ComboBox1Change(Sender: TObject);
begin
if combobox1.text=
'BUKU' then
ed1.Text:='7500'
else
if combobox1.text=
'PULPEN' then
ed1.Text:='3500'
else
if combobox1.text=
'TAS' then
ed1.Text:='15000'
else
ed1.Text:='0'
end;
procedure
TForm1.FormCreate(Sender: TObject);
begin
combobox1.Items.Add('BUKU');
combobox1.Items.add('PULPEN');
combobox1.Items.add('TAS');
end;
end.
Foam gaji
unit
UnitFormgaji;
interface
uses
Windows, Messages, SysUtils, Variants,
Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Edit6: TEdit;
ComboBox1: TComboBox;
Label9: TLabel;
Edit7: TEdit;
Label10: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure RadioButton1Click(Sender:
TObject);
procedure RadioButton2Click(Sender:
TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
a,b,c,d,e:Real;
// variabel global
implementation
{$R
*.dfm}
procedure
TForm1.Button1Click(Sender: TObject);
begin
if application.MessageBox('Anda
Yakin Ingin di Hitung ?',
'Konformasi',MB_YesNo)=MRYes
then
begin
a:=strtofloat(edit3.Text);
b:=strtofloat(edit4.Text);
c:=strtofloat(edit5.Text);
e:=strtofloat(edit7.Text);
e:=if 1
then 1*50000;
d:=(a+b)-(c)+e;
edit6.Text:=floattostr(d);
end;
end;
procedure
TForm1.Button2Click(Sender: TObject);
begin
edit1.Clear;
edit2.Clear;
edit3.Clear;
edit4.Clear;
edit5.Clear;
edit6.Clear;
combobox1.SetFocus;
end;
procedure
TForm1.Button3Click(Sender: TObject);
begin
if application.MessageBox('Apakah
Anda Yakin Ingin Keluar ?',
'Konformasi',MB_YesNo)=MRYes
then
begin
close;
end;
end;
procedure
TForm1.FormCreate(Sender: TObject);
begin
combobox1.Items.add('DIREKTUR');
combobox1.Items.add('MANAGER');
combobox1.Items.add('KARYAWAN');
end;
procedure
TForm1.ComboBox1Change(Sender: TObject);
begin
if
combobox1.text= 'DIREKTUR' then
edit3.Text:='15000000'
else
if
combobox1.text= 'MANAGER' then
edit3.Text:='10000000'
else
if
combobox1.text= 'KARYAWAN' then
edit3.Text:='2500000'
else
edit3.Text:='0'
end;
procedure
TForm1.RadioButton1Click(Sender: TObject);
begin
a:=strtofloat(edit3.Text);
if
radiobutton1.checked = true then
b:=a*0.2;
edit4.Text:=floattostr(b);
end;
procedure
TForm1.RadioButton2Click(Sender: TObject);
begin
a:=strtofloat(edit3.Text);
if
radiobutton2.checked = true then
b:=a*0;
edit4.Text:=floattostr(b);
end;
end.
Kalkulator
unit
UnitKalkulator;
interface
uses
Windows, Messages, SysUtils, Variants,
Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R
*.dfm}
procedure
TForm1.Button3Click(Sender: TObject);
var
A,B,C:INTEGER;
begin
A:=STRTOINT(EDIT1.TEXT);
B:=STRTOINT(EDIT2.TEXT);
C:=A+B;
EDIT3.TEXT:=INTTOSTR(C)
end;
procedure
TForm1.Button4Click(Sender: TObject);
var
A,B,C:INTEGER;
begin
A:=STRTOINT(EDIT1.TEXT);
B:=STRTOINT(EDIT2.TEXT);
C:=A-B;
EDIT3.Text:=INTTOSTR(C)
end;
procedure
TForm1.Button5Click(Sender: TObject);
var
A,B,C:INTEGER;
begin
A:=STRTOINT(EDIT1.TEXT);
B:=STRTOINT(EDIT2.TEXT);
C:=A*B;
EDIT3.Text:=INTTOSTR(C)
end;
procedure
TForm1.Button6Click(Sender: TObject);
var
A,B,C:INTEGER;
begin
A:=STRTOINT(EDIT1.TEXT);
B:=STRTOINT(EDIT2.TEXT);
C:=A div
B;
EDIT3.Text:=INTTOSTR(C)
end;
procedure
TForm1.Button1Click(Sender: TObject);
begin
EDIT1.TEXT:='
';
EDIT2.TEXT:='
';
EDIT3.TEXT:='
';
end;
procedure
TForm1.Button2Click(Sender: TObject);
begin
Close;
end;
procedure
TForm1.Button7Click(Sender: TObject);
begin
Form2.Show;
end;
end.
0 komentar:
Posting Komentar