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

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

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

Sign up to vote on this title
UsefulNot useful