Senin, 15 September 2014

Membuat Aplikasi Gaji Karyawan Delphi 7

membuat aplikasi gaji karyawan..
berikut source code nya.. comoot gan


var
Form1: TForm1;
gp, tj, ta, tl : real;

implementation

uses Math;

{$R *.dfm}

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
case ComboBox1.ItemIndex of
0 : Label2x.Caption := 'Agus';
1 : Label2x.Caption := 'Amin';
2 : Label2x.Caption := 'Anwar';
3 : Label2x.Caption := 'Asep';
end;
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
Edit1.Enabled := CheckBox1.Checked;
if CheckBox1.Checked = False then
Edit1.Text := '0';
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
If RadioButton1.Checked then gp := 900000;
if RadioButton2.Checked then gp := 1100000;
If RadioButton3.Checked then gp := 1400000;

if CheckBox1.Checked = true then tj := 0.2 * gp
else tj := 0.05 * gp;

if StrToInt(Edit1.Text)>= 3 then
ta := gp * 0.3
else
ta := gp * 0.1 * StrToInt(Edit1.Text);

tl := gp + tj + ta;
ListBox1.Items.Clear;
ListBox1.Items.Add('Gaji Pokok : '+formatcurr('Rp '+'###,##0',gp));
ListBox1.Items.Add('Tunj. Kel : '+formatcurr('Rp '+'###,##0',tj));
ListBox1.Items.Add('Tunj. Anak : '+formatcurr('Rp '+'###,##0',ta));
ListBox1.Items.Add('======================');
ListBox1.Items.Add('Gaji Pokok : '+formatcurr('Rp '+'###,##0',tl));
end;

end.
Foto: membuat aplikasi gaji karyawan..
berikut source code nya.. comoot gan


var
  Form1: TForm1;
  gp, tj, ta, tl : real;

implementation

uses Math;

{$R *.dfm}

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
    case ComboBox1.ItemIndex of
        0 : Label2x.Caption := 'Agus';
        1 : Label2x.Caption := 'Amin';
        2 : Label2x.Caption := 'Anwar';
        3 : Label2x.Caption := 'Asep';
    end;
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
   Edit1.Enabled := CheckBox1.Checked;
   if CheckBox1.Checked = False then
   Edit1.Text := '0';
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
   If RadioButton1.Checked then gp := 900000;
   if RadioButton2.Checked then gp := 1100000;
   If RadioButton3.Checked then gp := 1400000;

   if CheckBox1.Checked = true then tj := 0.2 * gp
   else tj := 0.05 * gp;

   if StrToInt(Edit1.Text)>= 3 then
      ta := gp * 0.3
   else
      ta := gp * 0.1 * StrToInt(Edit1.Text);

   tl := gp + tj + ta;
   ListBox1.Items.Clear;
   ListBox1.Items.Add('Gaji Pokok      : '+formatcurr('Rp '+'###,##0',gp));
   ListBox1.Items.Add('Tunj. Kel       : '+formatcurr('Rp '+'###,##0',tj));
   ListBox1.Items.Add('Tunj. Anak      : '+formatcurr('Rp '+'###,##0',ta));
   ListBox1.Items.Add('======================');
   ListBox1.Items.Add('Gaji Pokok      : '+formatcurr('Rp '+'###,##0',tl));
end;

end.

Tidak ada komentar:

Posting Komentar