P. 1
Listing Delphi Simple Calculator

Listing Delphi Simple Calculator

|Views: 7|Likes:
Dipublikasikan oleh Ashari Rahmat

More info:

Published by: Ashari Rahmat on Jan 22, 2013
Hak Cipta:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

11/09/2014

pdf

text

original

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

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

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

You're Reading a Free Preview

Mengunduh
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->