def fileToString(filename):
myFile = open(filename, "r")
myText = ""
for ch in myFile:
myText = myText + ch
return myText
def countVowels(text):
vcount = 0
vowels = ['a','e','i','o','u']
for letter in text:
if (letter in vowels):
vcount = vcount + 1
return vcount
write a program to calculate the following statistics from a text file:
Number of Vowels
Number of Consonants
Number of Words
Number of Sentences
Number of Questions
Average Word length
Average Sentence length
The program should give the user an option to display the statistics on screen and/or write them to a separate output file. Use functions to calculate each of the above and store the functions in a separate file, for importing into your main program. Include the following in your documentation:
Introduction
Flowchart
Pseudocode
Commented Code
Testing
Conclusion