C PROGRAM STRING AND FILE PROCESSING LEAVE COMMENTS! I WILL LEAVE POSITIVE REVIEW! THANK YOU :) I need...

90.2K

Verified Solution

Question

Programming

C PROGRAM STRING AND FILE PROCESSINGLEAVE COMMENTS! I WILL LEAVE POSITIVEREVIEW! THANK YOU :)

I need a program that

1) Count all words in a file. A word is any sequence ofcharacters 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 thefollowing rules:

•Each group of adjacent vowels (a, e, i, o, u, y) counts as onesyllable (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 atleast one syllable even if the previous rules give a count ofzero.

3) Count all sentences in the file. A sentence is a group ofwords terminated by a period, colon, semicolon, question mark, orexclamation mark. Multiples of each of these characters should betreated as the end of a single sentence. For example, “Fred saysso!!!” 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 functionrather than ceiling or floor)

Input

Your program will read the text to be analyzed from a file. Thefilename is to be given as a command line parameter to the program.You will name the program fleschIndex.c and will execute the codeon a file by doing the following:

./fleschIndex

For example, if you have a file with an essay and the file wasnamed example.txt then you would do the following to find theFlesch index:

./fleschIndex example.txt

Output

The output(to stdout) from your program will be thefollowing:

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 = 1

Answer & Explanation Solved by verified expert
3.7 Ratings (564 Votes)
give it a thumbs up C code put txt file along with c file include int main FILE fp char filename100 char chch2b int linecount wordcount    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students