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

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

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

Sign up to vote on this title
UsefulNot useful