Tampilan Program Persegi panjang yang akan kita buat
Download File RAR Program Persegi panjang 


Command Program


unit PERSEGI_PANJANG;

interface

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

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Label5: TLabel;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

Var p,l, luas, keliling : integer;
procedure TForm1.Button1Click(Sender: TObject);
begin

p := StrToInt(Edit1.Text);
l := StrToInt(Edit2.Text);


luas := p*l;
keliling := (p*l)*2 ;

Edit3.Text := IntToStr(luas);
Edit4.Text := IntToStr(keliling);

end;

procedure TForm1.Button3Click(Sender: TObject);
begin
Application.Terminate
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Text:=' ';
Edit2.Text:=' ';
Edit3.Text:=' ';
Edit4.Text:=' ';

end;

end.