Answered step by step
Verified Expert Solution
Question
1 Approved Answer
TREE PROJECT in c + + There is a real program developed by a computer company that reads a report ( running text ) and
TREE PROJECT in c
There is a real program developed by a computer company that reads a report running text and issues warnings on style and partially correct bad style. You are to write a simplified version of this program with the following features:
Statistics
A statistical summary with the following information:
Total number of words in the report
Number of unique words
Number of unique words of more than three letters
Average word length
Average sentence length
An index alphabetical listing of all the unique words see next page for a specific format
Style Warnings
Issue a warning in the following cases:
Word used too often: list each unique word of more than three letters if its usage is more than of the total number of words of more than three letters
Sentence length : write a warning message if the average sentence length is greater than
Word length : write a warning message if the average word length is greater than
Input
From the keyboard: The name of the file containing the text to be analyzed
From the file: The report to be analyzed.
Output
Write the following information to a file:
The name of the input file
The statistical summary of the report see Statistics above
The style warnings see Style Warnings above
Data Structures
A BST of unique words in the report, created as the file is read. If a word is not in the list, put it there. If it is increment a counter showing how many times the word has been used.
Definitions:
Word: Sequence of letters ending in a blank, a period, an exclamation point, a question mark, a colon, a comma, a single quote, or a semicolon. You may assume that numbers do not appear in the words; they may be ignored.
Unique word: Words that are spelled the same, ignoring uppercase and lowercase distinctions.
Sentence: Words between end of markers.
SAMPLE OUTPUT
FILE NAME: chapter.txt
STATISTICAL SUMMARY
TOTAL NUMBER OF WORDS:
TOTAL NUMBER OF UNIQUE WORDS:
TOTAL NUMBER OF UNIQUE WORDS OF MORE THAN THREE LETTERS:
AVERAGE WORD LENGTH: characters
AVERAGE SENTENCE LENGTH: words
STLE WARNINGS
WORDS USED TOO OFTEN: WORDS OF MORE THAN LETTERS THAT ARE USED MORE THAN OF THE TOTAL NUMBER OF WORDS OF MORE THAN LETTERS
Well
Total
Good
Since
Because
Little
AVERAGE SENTENCE LENGTH TOO LONG words
AVERAGE WORD LENGTH TOO LONG characters
INDEX OF UNIQUE WORDS
A
and
all
around
B
be
because
but
in c
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