Instructions: Write a C++ program that reads the attached file: space.txt and counts the number of sentences, words, and

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
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

Post by answerhappygod »

Instructions Write A C Program That Reads The Attached File Space Txt And Counts The Number Of Sentences Words And 1
Instructions Write A C Program That Reads The Attached File Space Txt And Counts The Number Of Sentences Words And 1 (186.22 KiB) Viewed 39 times
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%
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply