MATERI 2
PROGRAM APLIKASI
PENGGAJIAN KARYAWAN
- Adapun gambar dari form program aplikasinya seperti di bawah ini :
- SCRIPT CODE (LISTING PROGRAM)
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
tgaji: TEdit;
gol: TEdit;
gaji: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
tunj: TEdit;
total: TEdit;
proses: TButton;
procedure prosesClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.prosesClick(Sender: TObject);
var
gaji,tot,tunjang:integer;
begin
gaji:=strtoint(tgaji.Text);
if gol.Text='A' then tunjang:=100000;
if gol.Text='B' then tunjang:=200000;
if gol.Text='C' then tunjang:=300000;
tunj.text:=inttostr(tunjang);
tot:=gaji+tunjang;
total.text:=inttostr(tot);
end;
end.
- FORM RUNNING PROGRAM
0 komentar:
Posting Komentar