Professional Documents
Culture Documents
Programa Vocales Delphi
Programa Vocales Delphi
Form1: TForm1;
X: String;
Y: Integer;
vocal: Integer;
conso: Integer;
space: Integer;
implementation
{$R *.DFM}
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.