Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

var

Form1: TForm1;
X: String;
Y: Integer;
vocal: Integer;
conso: Integer;
space: Integer;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);


Var
J: Integer;

begin

X:=Edit1.Text;
Y:=Length(Edit1.Text);
For J:=1 to Y do
Begin
If (X[J]='a') or (X[J]='e') or (X[J]='i') or (X[J]='o') or (X[J]='u') or (X[J]='A') or (X[J]='E') or (X[J]='I') or
(X[J]='O') or (X[J]='U') Then
begin
vocal:=vocal+1;
end
Else
begin
If X[J]=' ' Then
begin
space:=space+1
end
Else
begin
conso:=conso+1;
end;
end;
end;
Label1.Caption:='Vocales : '+ InttoStr(vocal);
Label2.Caption:='Consonantes : '+ InttoStr(conso);
Label3.Caption:='Espacios: '+ InttoStr(space);
end;

end.

You might also like