Program menghitung volume dan luas lingkaran

Buat Form seperti dibawah

vol

Listing Program :

unit Unit1;

interface

uses
Windows, Message0s, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
implementation
{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
r,l,v : real;
begin
r:= strtofloat(edit1.Text);
v :=4/3 *3.14 * r * r * r;
l :=4 * 3.14 * r * r;
edit2.Text := floattostr (v);
edit3.Text := floattostr (l);
end;
end.

Tampilan ketika dijalankan :

volume2.jpg

Posted on Maret 27, 2008, in Delphi and tagged . Bookmark the permalink. Tinggalkan komentar.

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: