You will be developing a Text Processor in C++. The functionalities needed to be implemented are given below: 1. Reads a paragraph from a
You will be developing a Text Processor in C++. The functionalities needed to be implemented are given below: 1. Reads a paragraph from a file, using the insertion operator >> 2. Write the paragraph to a file, using the extraction operator < < 3. Display the paragraph on screen, using the extraction operator < < 4. Checks if two paragraphs are equal, using the operator == 5. Convert all characters of the paragraph to UPPERCASE or lowercase, must have a Boolean flag that determines if the text is in lowercase or UPPERCASE. Overload unary operator '+' for UPPERCASE and ' for lowercase conversion. 6. Count the number of English and Punctuation characters in the paragraph 7. Count number of characters in every word of every sentence. 8. Count number of words in every paragraph, in every sentence, a word is terminated on a space character 9. Count number of sentences in the whole text, in every paragraph as well. A sentence is terminated on a full stop .' Task 1: At first we will use a single class named Paragraph to implement the text processor. The very first task is to write the class definition for Paragraph using the following standard artifacts: I A constructor that takes default parameters for each private variable, other than those that can be assigned or calculated I Copy constructor I Getter and Setter for each private variable I Don't provide function where you can overload operators, therefore must provide the following operators: o Assignment operator = o Equal operator == o Not equal operator != o Insertion operator >> for reading from a file o Extract operator >> for writing in a file and writing on console as well (displaying on screen) o Unary operators as indicated above Task 2: Now instead of using a single class, we will use more than one class and see how this problem becomes more easy to manage. Now come up with the final solution which have separate class for every separate entity. Write the class definitions (.h files) for each class. Task 3: Provide the implementation (.cpp files) of the classes declared in task 2 and write a driver programme to test them. Task 4: (Output file) Your task is to provide output file named "Frequency.txt" which should contain frequency of paragraphs in whole text, sentences in each paragraph and frequency of words in each sentence of each paragraph. For eg: Paragraph number: 1 Sentences in Paragraph 1: 2 Words in Sentence no 1:5 Characters in word no 1 of sentence no 1: 3 Characters in word no 2 of sentence no 1: 2 Characters in word no 3 of sentence no 1:4 Characters in word no 4 of sentence no 1:5 Characters in word no 5 of sentence no 1: 3 Words in Sentence no 2:4 Characters in word no 1 of sentence no 2: 2 Characters in word no 2 of sentence no 2: 3 Characters in word no 3 of sentence no 2: 1 Characters in word no 4 of sentence no 2: 5
Step by Step Solution
3.48 Rating (151 Votes )
There are 3 Steps involved in it
Step: 1
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