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

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

Sign up to vote on this title
UsefulNot useful