Here is the space.txt files contents:
Please upload the code and not a screenshot of the code. Thank
you!
Instructions: Write a C++ program that reads the attached file: space.txt and counts the number of sentences, words, and syllables the file contains. With the above counts, the program calculates the Flesch Reading-Ease Score and the Flesch-Kincaid Grade Level, using the following formulas: Flesch Reading-Ease Score (FRES): 206.835 - 1.015 x (total words / total sentences) - 84.6 x (total syllables / total words) Flesch-Kincaid Grade Level (FKGL): 0.39 x (total words / total sentences) + 11.8 x (total syllables / total words) - 15.59 Counting rules (simplified for this assignment): 1. Sentences are delimited by a dot. 2. Words are delimited by one or more consecutive spaces or new lines. 3. Syllables: each vowel in a word is considered one syllable, subject to: Words with three letters or shorter count as single syllables b. The letter 'y' counts as a vowel Consecutive vowels count as one syllable d. The word endings -es, -ed and -e (except -le) are not counted as syllables a. C. Examples of counting vowels: • The word 'character' has 3 vowels; therefore, it is a 3-syllable word. • The word 'already' has 4 vowels (counting 'y' as vowel) but since 'e' and 'a' are consecutive, we only count it as having 3 syllables. • The word 'imperative' has 5 vowels, but it ends with 'e' (but not 'le'); thus, we count it as having 4 syllables. • The word 'based' has 2 vowels, but since it ends with 'ed', we count it as one- syllable. Sample Program Run: File has 22 sentences, 496 words and 720 syllables Flesch Reading Ease Score: 61.1449 Flesch-Kincaid Grade Level: 10.3318 Note: Due to different approaches used for reading and counting, your numbers may be slightly different from those shown above but still acceptable.
Notes: 1. You may only use material covered in this course so far 2. Programs with syntax errors will not be accepted. Grading Criteria: 1. Program / Module Description: 10% 2. Following course coding conventions: 10% 3. Correct sentence count: 10% 4. Correct word count: 10% 5. Correct syllable count: 30% 6. Correct implementation of FRES formula: 15% 7. Correct implementation of FKGL formula: 15%
Instructions: Write a C++ program that reads the attached file: space.txt and counts the number of sentences, words, and
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Instructions: Write a C++ program that reads the attached file: space.txt and counts the number of sentences, words, and
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!