Penggajian Karyawan
unit tugas;
end.
unit tugas;
interface
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;
Label8: TLabel;
nip: TEdit;
nama: TEdit;
gapok: TEdit;
fasilitas: TEdit;
jabatan: TComboBox;
total: TEdit;
bersih: TButton;
keluar: TButton;
GroupBox1: TGroupBox;
honorer: TRadioButton;
tetap: TRadioButton;
procedure FormCreate(Sender: TObject);
procedure jabatanClick(Sender: TObject);
procedure bersihClick(Sender: TObject);
procedure keluarClick(Sender: TObject);
procedure honorerClick(Sender: TObject);
procedure tetapClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
a,hasil:real;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
jabatan.Items.add('Direktur');
jabatan.Items.add('Manager');
jabatan.Items.add('Karyawan');
end;
procedure TForm1.jabatanClick(Sender: TObject);
begin
if jabatan.Text='Direktur' then
begin
gapok.text:='10000000';
fasilitas.Text:='Rumah'
end
else
if jabatan.Text='Manager' then
begin
gapok.text:='7000000';
fasilitas.Text:='Mobil'
end
else
if jabatan.Text='Karyawan' then
begin
gapok.text:='5000000';
fasilitas.Text:='Motor'
end
else
gapok.Text:='0';
end;
procedure TForm1.bersihClick(Sender: TObject);
begin
nip.Text:='';
nama.Text:='';
jabatan.Text:='';
gapok.Text:='';
fasilitas.text:='';
total.Text:='';
end;
procedure TForm1.keluarClick(Sender: TObject);
begin
close
end;
procedure TForm1.honorerClick(Sender: TObject);
begin
if honorer.checked=true then
a:=strtofloat(gapok.text);
hasil:=a-(0.1*a);
total.text:=floattostr(hasil);
end;
procedure TForm1.tetapClick(Sender: TObject);
begin
if honorer.checked=true then
a:=strtofloat(gapok.text);
hasil:=a+(0.1*a);
total.text:=floattostr(hasil);
end;
Post a Comment