Delphi - Program Menghitung Luas Persegi Panjang

Bentuk rancangan Form nya adalah seperti berikut :
















Button Hitung
procedure TForm1.Button1Click(Sender: TObject);
var panjang, lebar, luas : real;
begin
panjang := strtofloat(edit1.Text);
lebar := strtofloat(edit2.Text);
luas := panjang * lebar;
edit3.Text := floattostr(luas);
end;
Button Reset
procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.Text:=' ';
edit2.Text:=' ';
edit3.Text:=' ';
edit1.setFocus;
end;
Button Keluar
procedure TForm1.Button3Click(Sender: TObject);
begin
Close;
end;


end.
Share on Google Plus

About Stevanina

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment