Program if dengan delphi
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Label3: TLabel;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
nilai:integer;
begin
nilai:=StrToInt(edit1.text);
if Nilai>=75 then
label3.Caption:='Anda Lulus'
else
label3.Caption:='Anda Tidak Lulus'
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Label3: TLabel;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
nilai:integer;
begin
nilai:=StrToInt(edit1.text);
if Nilai>=75 then
label3.Caption:='Anda Lulus'
else
label3.Caption:='Anda Tidak Lulus'
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
end.
Komentar
Posting Komentar