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

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

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