
Patrick B. answered 07/12/19
Math and computer tutor/teacher
Program CountVowels ( infile,output) ;
Var Infile: text;
ch :char;
vowelCount : integer;
Begin
assign(infile,'input.dat');
reset(infile);
{* writeln(' opens input file '); *}
vowelCount :=0;
while not eof(infile) do
begin
read(infile,ch);
{* uncomment this for debugging : writeln(ch); *}
case (ch) of
'A','a','E','e','I','i','O','o','U','u':
vowelCount := vowelCount + 1;
end;
end;
writeln(' # of vowels is ',vowelCount);
close(infile);
End.