Listing Program unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs

, StdCtrls; type TForm1 = class(TForm) Masukkan_Nilai_1: TLabel; Masukkan_Nilai_2: TLabel; ENilai1: TEdit; ENilai2: TEdit; btambah: TButton; bkurang: TButton; bkali: TButton; bbagi: TButton; Hasil: TLabel; Operator: TLabel; Ehasil: TEdit; binput: TButton; bkeluar: TButton; procedure FormCreate(Sender: TObject); procedure btambahClick(Sender: TObject); procedure bkurangClick(Sender: TObject); procedure bkaliClick(Sender: TObject); procedure bbagiClick(Sender: TObject); procedure binputClick(Sender: TObject); procedure bkeluarClick(Sender: TObject); private { Private declarations } public { Public declarations } procedure bersih; procedure aktif; procedure nonaktif; end; var Form1: TForm1; a,b,c : real; implementation

bkurangClick(Sender: TObject).Text :=''.nonaktif. bbagi. //tombol kurang procedure TForm1. end. bkurang. ehasil.Text). bersih.FormCreate(Sender: TObject). enilai2. end. begin enilai1.Text :=''.aktif. ehasil. procedure tform1. b:=strtofloat(enilai2.Enabled:=false. //tombol tambah procedure TForm1.bersih. begin a:=strtofloat(enilai1.Enabled:=false.Enabled:=true. begin . c:=a+b. begin enilai1. ehasil.{$R *.Enabled:=false.Enabled:=false.Enabled:=false. end.Text :=floattostr(c). enilai2. bkali. begin nonaktif. btambah.Enabled:=true.dfm} procedure Tform1. ehasil.Enabled:=false. begin enilai1.Enabled:=true. procedure tform1.Text).btambahClick(Sender: TObject). //saat pertama kali program running procedure TForm1. end.Text :=''. enilai2. end.Enabled:=false.

//tombol keluar procedure TForm1.Text).Text). b:=strtofloat(enilai2. close. .mtconfirmation.Enabled:=true. c:=a/b.Text:=floattostr(c).Text).bkaliClick(Sender: TObject).binputClick(Sender: TObject). end. b:=strtofloat(enilai2.0). bbagi.Enabled:=true. //tombol kali procedure TForm1.Text).bkeluarClick(Sender: TObject). end. begin aktif. begin messagedlg('Ingin menutup form ini ?'.SetFocus. b:=strtofloat(enilai2. enilai1. c:=a*b. ehasil. //tombol bagi procedure TForm1. begin a:=strtofloat(enilai1.Text:=floattostr(c). begin a:=strtofloat(enilai1. bkali. bkurang.bbagiClick(Sender: TObject). bersih. c:=a-b. btambah.a:=strtofloat(enilai1. ehasil. end. //tombol input procedure TForm1. end.Text).Enabled:=true. end.Text).[mbok].Text:=floattostr(c). end. ehasil.Enabled:=true.