Write a program that analyzes a single sentence for grammatical statistics. The sentence should be read from a text file and its string length should be no greater than 80. Your program should include 5 functions which count:
a) number of printable characters (including symbols such as apostrophes, question marks, etc).
b)number of white space (or non-printing ) characters.
c)number of vowels.
d) number of consonants.
e) frequency of each vowel.
You should include your own function code in your program for e) and any two from a)-d). Code for the remaining two functions should be obtained by exchange and /or agreement with any two others in the class and incorporated into your program. The author of each function appear as header comment to that function. Functions a)-d) should return a single statistical count, whilst function e) should return counts by reference. All functions should return -1 if they fail for any reason.
Once all functions are assembled in your program, use data to derive and print to screen the following statistics; i) string length ii) ratio of printing to non-printing characters iii) ratio of vowels to consonants and iv)a list of the frequency with which each vowel appears in the string as percentage of the number of printing characters.
Hint : Although functions are not dealt with until topic 4, passing arrays to functions until topic 6 and file reading until topic 7 you could start work on any function as a stand alone program which reads a sentence input from the keyboard. It should be subsequently straightforward to modify the code later as specific examples of how to pass an array to a function and read a single sentence of known maximum length from a file are given in the module booklet