Tugas Delphi Program Sederhana

15 04 2015

tugassssss

interface

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

type
TForm5 = class(TForm)
Image1: TImage;
Image2: TImage;
HAPUS: TButton;
KELUAR: TButton;
GroupBox1: TGroupBox;
Label3: TLabel;
Label4: TLabel;
P: TEdit;
L: TEdit;
LUAS_PERSEGI: TButton;
HASILLP: TEdit;
HASILKP: TEdit;
KELILING_PERSEGI: TButton;
GroupBox2: TGroupBox;
Label6: TLabel;
R: TEdit;
HASILKL: TEdit;
HASILLL: TEdit;
KELILING_LINGKARAN: TButton;
LUAS_LINGKARAN: TButton;
procedure LUAS_PERSEGIClick(Sender: TObject);
procedure KELILING_PERSEGIClick(Sender: TObject);
procedure LUAS_LINGKARANClick(Sender: TObject);
procedure KELILING_LINGKARANClick(Sender: TObject);
procedure HAPUSClick(Sender: TObject);
procedure KELUARClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
panjang,lebar,hasil:Real;
a,b:Real;

end;

var
Form5: TForm5;

implementation

{$R *.dfm}

procedure TForm5.LUAS_PERSEGIClick(Sender: TObject);
begin
panjang:=StrToInt(P.Text);
lebar:=StrToInt(L.Text);
hasil:=panjang*lebar;
HASILLP.Text:=FloatToStr(hasil);
end;

procedure TForm5.KELILING_PERSEGIClick(Sender: TObject);
begin
panjang:=StrToInt(P.Text);
lebar:=StrToInt(L.Text);
hasil:= 2*(panjang+lebar);
HASILKP.Text:=FloatToStr(hasil);
end;

procedure TForm5.LUAS_LINGKARANClick(Sender: TObject);
begin
a:=StrToInt(R.Text);
b:=3.14*(a*a);
HASILLL.Text:=FloatToStr(b);
end;

procedure TForm5.KELILING_LINGKARANClick(Sender: TObject);
begin
a:=StrToInt(R.Text);
b:=2*(3.14*a);
HASILKL.Text:=FloatToStr(b);

end;

procedure TForm5.HAPUSClick(Sender: TObject);
begin
P.Text:=”;
L.Text:=”;
HASILLP.Text:=”;
HASILKP.Text:=”;
R.Text:=”;
HASILLL.Text:=”;
HASILKL.Text:=”;
end;

procedure TForm5.KELUARClick(Sender: TObject);
begin
IF (Application.MessageBox(‘Mau Keluar?’,’informasi’,
MB_YESNO)=ID_YES)then
Close;
end;

end.

Advertisements

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: