Kamis, 25 April 2013 Writen 0 komentar » Posted in

UTS Semester Genap - Gaji Pokok (Latihan1)


Source Code
unit Latihan1; 
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
   TForm1 = class(TForm)
       Label2: TLabel;
       Label3: TLabel;
       Label4: TLabel;
       Button1: TButton;
       Edit1: TEdit;
       tGaji: TEdit;
       tGol: TEdit;
       total: TLabel;
       Tunj: TLabel;
       Label1: TLabel;
       procedure Button1Click(Sender: TObject);
   private
     { Private declarations }
   public
     { Public declarations }
end;

 var
    Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
 var
     gaji,tot,tunjang:integer;
begin
    gaji:=StrToInt(tGaji.Text);
    if tGol.Text ='A' then tunjang:=10000;
    if tGol.Text ='B' then tunjang:=20000;
    if tGol.Text ='C' then tunjang:=30000;
    tunj.Caption := IntToStr(Tunjang);
    tot:=Tunjang-Gaji;
    Total.Caption := IntToStr(Tot);
end;

end.

Hasil Proses

0 komentar:

Posting Komentar