Related questions
It should be a C++ PROGRAM INCLUDE THE HEADER FILE, MAIN CPP AND BSTREE.CPP
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 5% 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 10
- Word length : write a warning message if the average word length is greater than 5
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: 987
TOTAL NUMBER OF "UNIQUE" WORDS: 679
TOTAL NUMBER OF "UNIQUE" WORDS OF MORE THAN THREE LETTERS: 354
AVERAGE WORD LENGTH: 8 characters
AVERAGE SENTENCE LENGTH: 12 words
STLE WARNINGS
WORDS USED TOO OFTEN: ( WORDS OF MORE THAN 3 LETTERS THAT ARE USED MORE THAN 5% OF THE TOTAL NUMBER OF WORDS OF MORE THAN 3 LETTERS )
1) Well
2) Total
3) Good
4) Since
5) Because
6) Little
AVERAGE SENTENCE LENGTH TOO LONG – 12 words
AVERAGE WORD LENGTH TOO LONG – 8 characters
INDEX OF UNIQUE WORDS
A
and
all
around
...
B
be
because
but
...
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 3 images
- In vim, when the cursor is on the first letter of a word, you may capitalise it by typing x and then p.arrow_forwardCommand Program Create a program that allows you to view and edit the sales amounts for each month of the current year. This program is required to use commands add, view, totals, edit, and exit. The program should use a list to store the sales data for each month with the three-letter abbreviation for the month (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, and Dec) to use as the key for each item. When the program starts, it should read the sales data inserted from the user. If the user edits the sales data, the program should edit the data If the user selects total, then the program should calculate the total sales and average monthly sales. Use functions to view sales, edit sales, calculate total, and calculate average. Please use all commands, and thank you in advance.arrow_forwardIn c++, Using STL containers, components, and algorithms show all data from the text file movies.txt. Please make sure the list updates once the user adds a new movie to the text file. Console Movies program COMMAND MENU show - user is able to see all available movies from movies.txt command: show The Adventures of a Babysitter 10ドル Barney 25ドル Larry the Car Man 15ドル Dora and the missing map 15ドル Ceasar and the Lunch Lady 10ドル Suzie and the Bad Kids 13ドル.95 command: add cout << "What movie do you want to add?"; cin >> BeeHive 12ドル; cout << "Movie added"; command:show The Adventures of a Babysitter 10ドル Barney 25ドル Larry the Car Man 15ドル Dora and the missing map 15ドル Ceasar and the Lunch Lady 10ドル Suzie and the Bad Kids 13ドル.95 Beehive 12ドル movies.txt with all possible movies: The Adventures of a Babysitter 10ドル Barney 25ドル Larry the Car Man 15ドル Dora and the missing map 15ドル Ceasar and the Lunch Lady 10ドル Suzie and the Bad Kids 13ドル.95arrow_forward
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education