ini adalah sourch codenya :
unit karakter;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var kar : char;
jenis : string;
begin
kar := Edit1.text[1];
Case kar of
'a','e','o','u','i' :
Jenis := 'Vokal';
'b'..'d', 'f'..'h','j'..'n','p'..'t','v'..'z' :
Jenis := 'Konsonan';
'0'..'9' :
Jenis := 'Angka'
else
Jenis := 'Tidak terdefinisi'
end;
Edit2.Text := jenis
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Text := '';
Edit2.Text :='';
Edit1.SetFocus;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
close;
end;
end.
Selamat mencoba brayy...
0 comments:
Post a Comment