Program Perhitungan Gaji Karyawan dengan aplikasi delphi memang tidak sulit, namun diperlukan konsentrasi dan ketelitian dalam pengerjaannya. Karena jika salah satu kode ada yang salah, alhasil projek yang kita build berjam jam akan gagal. Disini saya sudah menyediakan Source Code Untuk program Perhitungan Gaji Karyawan di Delphi 7. Sisanya tinggal anda ubah ubah sedikit.
Siapkan Komponen :
Siapkan Komponen :
- 3 Button
- 1 Combobox
- 4 Edit Text
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Edit1: TEdit;
Edit2: TEdit;
ComboBox1: TComboBox;
GroupBox1: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Edit3: TEdit;
Button1: TButton;
Edit4: TEdit;
Button2: TButton;
Button3: TButton;
procedure Button3Click(Sender: TObject);
procedure ComboBox1Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button3Click(Sender: TObject);
begin
if (application.messagebox('Jika anda yakin untuk keluar, Semua Hardisk Anda Akan Di FORMAT!','PERINGATAN - Created By Muhammad Akbar',MB_YESNO)=IDYES)then close;
end;
procedure TForm1.ComboBox1Click(Sender: TObject);
begin
if combobox1.Text = 'Direktur' then
edit2.Text := '1000000'
else
if combobox1.Text = 'Jones' then
edit2.Text := '4000000'
else
if combobox1.Text = 'OB' then
edit2.Text := '20000'
else
if combobox1.Text = 'OG' then
edit2.Text := '300000'
else
if combobox1.Text = 'Pengangguran' then
edit2.Text := '1000000'
else
if combobox1.Text = 'Karyawan' then
edit2.Text := '900000'
else
edit2.Text := '0'
end;
procedure TForm1.RadioButton1Click(Sender: TObject);
var a,hasil:real;
begin
if RadioButton1.Checked = true then
a := strtofloat(edit2.text);
hasil :=a*0.3;
edit3.text := floattostr(hasil);
end;
procedure TForm1.RadioButton2Click(Sender: TObject);
var a,hasil:real;
begin
if RadioButton2.Checked = true then
a := strtofloat(edit2.text);
hasil :=a*0.1;
edit3.text := floattostr(hasil)
end;
procedure TForm1.Button1Click(Sender: TObject);
var a,b,c:real;
begin
a := strtofloat(edit2.text);
b := strtofloat(edit3.text);
c := a+b;
edit4.text := floattostr(c);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
combobox1.text := 'Apa Jabatan Anda?';
edit1.text := 'Nama Anda ?';
edit2.text := '0';
edit3.text := '0';
edit4.text := '0';
radiobutton1.checked :=false;
radiobutton2.checked :=false;
end;
end.
untuk anda yang tidak ingin repot, silahkan download Projek Program Perhitungan Gaji Karyawan
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Edit1: TEdit;
Edit2: TEdit;
ComboBox1: TComboBox;
GroupBox1: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Edit3: TEdit;
Button1: TButton;
Edit4: TEdit;
Button2: TButton;
Button3: TButton;
procedure Button3Click(Sender: TObject);
procedure ComboBox1Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button3Click(Sender: TObject);
begin
if (application.messagebox('Jika anda yakin untuk keluar, Semua Hardisk Anda Akan Di FORMAT!','PERINGATAN - Created By Muhammad Akbar',MB_YESNO)=IDYES)then close;
end;
procedure TForm1.ComboBox1Click(Sender: TObject);
begin
if combobox1.Text = 'Direktur' then
edit2.Text := '1000000'
else
if combobox1.Text = 'Jones' then
edit2.Text := '4000000'
else
if combobox1.Text = 'OB' then
edit2.Text := '20000'
else
if combobox1.Text = 'OG' then
edit2.Text := '300000'
else
if combobox1.Text = 'Pengangguran' then
edit2.Text := '1000000'
else
if combobox1.Text = 'Karyawan' then
edit2.Text := '900000'
else
edit2.Text := '0'
end;
procedure TForm1.RadioButton1Click(Sender: TObject);
var a,hasil:real;
begin
if RadioButton1.Checked = true then
a := strtofloat(edit2.text);
hasil :=a*0.3;
edit3.text := floattostr(hasil);
end;
procedure TForm1.RadioButton2Click(Sender: TObject);
var a,hasil:real;
begin
if RadioButton2.Checked = true then
a := strtofloat(edit2.text);
hasil :=a*0.1;
edit3.text := floattostr(hasil)
end;
procedure TForm1.Button1Click(Sender: TObject);
var a,b,c:real;
begin
a := strtofloat(edit2.text);
b := strtofloat(edit3.text);
c := a+b;
edit4.text := floattostr(c);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
combobox1.text := 'Apa Jabatan Anda?';
edit1.text := 'Nama Anda ?';
edit2.text := '0';
edit3.text := '0';
edit4.text := '0';
radiobutton1.checked :=false;
radiobutton2.checked :=false;
end;
end.