C++ Write a program that counts the number of times that each letter of the alph
ID: 648696 • Letter: C
Question
C++
Write a program that counts the number of times that each letter of the alphabet occurs in a file. Do not distinguish upper and lower case letters.
declare an array of 26 characters, letters
declare an array of 26 integers, counts
fill the integer array with zeros
capacity := 26
population := 0
open file
character := read-character
while not end of file
if character is letter then
convert character to upper case
position := find(letters, character)
if position = - 1 then
letters[population] := character
counts[population] := 1
add 1 to population
else
add 1 to counts[position]
end if
character := read-character
end while
write letters, counts to file