Question
Hello! i need a program in C that uses FILE*! The instructions are below! Please dont copy paste another chegg post! Thank you! Will leave
Hello! i need a program in C that uses FILE*! The instructions are below!
Please dont copy paste another chegg post! Thank you! Will leave positive review!
I need a program that
1) Count all words in a file. A word is any sequence of characters delimited by white space or the end of a sentence, whether or not it is an actual English word.
2)Count all syllables in each word. To make this simple, use the following rules:
Each group of adjacent vowels (a, e, i, o, u, y) counts as one syllable (for example, the ea in real counts as one syllable, but the e..a in regal count as two syllables). However, an e at the end of a word does not count as a syllable. Each word has at least one syllable even if the previous rules give a count of zero.
3) Count all sentences in the file. A sentence is a group of words terminated by a period, colon, semicolon, question mark, or exclamation mark. Multiples of each of these characters should be treated as the end of a single sentence. For example, Fred says so!!! is one sentence.
4) Calculates the Flesh index which is is computed by: index= 206.835 84.6 * ( #syllables / #words) 1.015 * (#words / #sentences) rounded to the nearest integer (use the round function rather than ceiling or floor)
Input
Your program will read the text to be analyzed from a file. The filename is to be given as a command line parameter to the program. You will name the program fleschIndex.c and will execute the code on a file by doing the following:
./fleschIndex
For example, if you have a file with an essay and the file was named example.txt then you would do the following to find the Flesch index:
./fleschIndex example.txt
Output
The output(to stdout) from your program will be the following:
1. The Flesch/legibility index that you have computed
2. The number of syllables in the input
3. The number of words in the input
4. The number of sentences in the input
It will have the following format (and must match exactly):
OUTPUT TO CONSOLE
Flesch Index = 87
Syllable Count = 10238
Word Count = 2032
Sentence Count = 17
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started