program perhitungan kuadrat
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Panel1: TPanel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
x,y:Real;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
x:=StrToFloat(edit1.Text);
y:=StrToFloat(edit2.Text);
if (x>=0) and (y>=0)
then
begin
Edit3.text:='KUADRAN 1';
end else
if (x>=0) and (y<0)
then
begin
edit3.text:='KUADRAN 2';
end else
if (x<0) and (y<0) then
begin
edit3.text:='KUADRAN 3';
end else
edit3.Text:='KUADRAN 4';
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Clear;
Edit2.Clear;
Edit3.Clear;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
close;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Panel1: TPanel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
x,y:Real;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
x:=StrToFloat(edit1.Text);
y:=StrToFloat(edit2.Text);
if (x>=0) and (y>=0)
then
begin
Edit3.text:='KUADRAN 1';
end else
if (x>=0) and (y<0)
then
begin
edit3.text:='KUADRAN 2';
end else
if (x<0) and (y<0) then
begin
edit3.text:='KUADRAN 3';
end else
edit3.Text:='KUADRAN 4';
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Clear;
Edit2.Clear;
Edit3.Clear;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
close;
end;
end.