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

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

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

Sign up to vote on this title
UsefulNot useful