You will be developing a Text Processor in C++. The functionalities needed to be implemented are...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Related Book For
Digital Signal Processing
ISBN: ?978-0133737622
3rd Edition
Authors: Jonh G. Proakis, Dimitris G.Manolakis
Posted Date:
Students also viewed these programming questions
-
Write a sed program named ins that copies a file to standard output, changing all occurrences of cat to dog and preceding each modified line with a line that says following line is modified:
-
A standard setter recently made a private remark that conservatism was a "barbaric relic" that violated the "neutrality" requirement of accounting information and that financial statements would be...
-
A class of fourth graders takes a diagnostic reading test, and the scores are reported by reading grade level. The 5-number summaries for the 14 boys and 11 girls are shown: a) Which group had the...
-
A trial balance was extracted from the books of V Baker, and it was found that the debit side exceeded the credit side by 40. This amount was entered in the suspense account. The following errors...
-
Using the impossible trinity, explain whether you agree or disagree with the following statement. "If a central bank sets an exchange rate target, it abandons control of the domestic money supply and...
-
A first year co-op student working for UR Here.com recorded the transactions for the month. He wasnt exactly sure how to journalize and post, but he did the best he could. He had a few questions,...
-
Define a sequence of correlated random numbers \[ s_{k}=\alpha s_{k-1}+(1-\alpha) r_{k} \] where \(r_{k}\) is a unit-variance, uncorrelated, Gaussian pseudorandom number while \(0
-
The Sanding Department of Richards Furniture Company has the following production and manufacturing cost data for March 2012, the first month of operation. Production: 9,000 units finished and...
-
1. Assuming firms in a market face a linear downward-sloping demand curve and constant marginal and average costs, carefully explain where equilibrium price would be if it were a competitive market....
-
Table 5.7 shows a small set of predictive model validation results for a classification model, with both actual values and propensities. a. Calculate error rates, sensitivity, and specificity using...
-
PT Fresh Juice is a company that produces fruit juice with various variants packaged in glass bottles, plastic bottles and plastic cups. In early 2018, PT Fresh Juice bought a company, namely PT...
-
For the following REDOX reaction, state the oxidation number for each element in the reaction. State which element is being oxidized and which element is being reduced, as well as how you know. State...
-
Common stock with a total par value of $80,000 is issued at a total of $110,000. The $30,000 excess above the par value should be recorded as a CREDIT to which account?
-
Clausewitz used this term to describe those assets key to an enemy's ability to survive and carry out warfare. A successful belligerent can attack and seize or destroy these assets. Examples of such...
-
What are the ecological implications of trophic interactions and food chain dynamics for ecosystem services provisioning, including the regulation of pest populations, pollination services, nutrient...
-
Explain the difference between statutory law, common law, and business law. ?
-
What is meant by "infrastructure as code" in SecDevOps? Group of answer choices SecDevOps method of managing software and hardware using principles of developing code SecDevOps method of managing the...
-
7 A 29-year-old, previously healthy man suddenly collapses at a party where legal and illicit drugs are being used. Enroute to the hospital, he requires resuscitation with defibrillation to establish...
-
An MA(2) process has the autocorrelation sequence (a) Determine the coefficients of the MA(2) process that have the foregoing autocorrelation. (b) Is the solution unique? If not, give all the...
-
Derive the signal flow graph for the N = 16 points, radix-4 decimation-in-frequency FFT algorithm in which the input sequence is in digit-reversed order and the output DFT is in normal order.
-
Le x(n) be a signal with Fourier transforms as shown in figure. Determine and sketch the Fourier Transforms of the following signals.(a) x1(n) = x(n) cos(?n/4)(b) x2(n) = x(n) sin(?n/2)(c) x3(n) =...
-
Solve the matrix equation \([\mathbf{K}]\{\mathbf{Q}\}=\{\mathbf{F}\}\) using forward reduction and backward substitution, where, 5-10 [K] = -13-1 0-1 1 {F}= 0
-
Volunteer work can improve your skills and enhance your rsum. With a partner, seek volunteer opportunities on your campus or in your city. Make a list of volunteer groups that may need help. Here are...
-
What are six brainstorming questions to consider before starting your proposal?
Study smarter with the SolutionInn App