Membuat program penjumlahan, pengurangan, perkalian, dan pembagian

Gambarnya blum di upload euy. sementara kodenya dulu :

#update 04des09# Mohon maaf sebelumnya buat yang protes, saya lupa upload gambarnya soalnya udah lama banget.

Buat form seperti di bawah

Sourcecodenya sbb:


unit Unit1;
interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Editbilangan1: TEdit;
Editbilangan2: TEdit;
Edithasil: TEdit;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
x,y,z : real;
implementation
{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
x:= strtofloat (Editbilangan1.Text);
y:= strtofloat (Editbilangan2.Text);
z:= x + y;
Edithasil.Text := floattostr (z);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
x:= strtofloat (Editbilangan1.Text);
y:= strtofloat (Editbilangan2.Text);
z:= x - y;
Edithasil.Text := floattostr (z);
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
x:= strtofloat (Editbilangan1.Text);
y:= strtofloat (Editbilangan2.Text);
z:= x * y;
Edithasil.Text := floattostr (z);
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
x:= strtofloat (Editbilangan1.Text);
y:= strtofloat (Editbilangan2.Text);
z:= x / y;
Edithasil.Text := floattostr (z);
end;
end.

Hasilnya sebagai berikut :

Posted on Maret 24, 2008, in Delphi and tagged , , , . Bookmark the permalink. 4 Komentar.

  1. goblok lek gawe kek’ono gambar ta blok……………
    congok………………

  2. nda ngerttii sayaa ..

  3. thx bgt ych…. artikelnya sangat membantu

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: