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...
-
Parts and materials for the skis made by the Downhill Adventures Company are supplied by two suppliers. Supplier As materials make up 30% of what is used, with Supplier B providing the rest. Past...
-
Ken Howard, financial analyst at JVR Corporation, is examining the behavior of quarterly maintenance costs for budgeting purposes. Howard collects the following data on machine-hours worked and...
-
What is an Engineered System?
-
Lance Prating is the controller of the Colorado Springs manufacturing facility of Advance Macro, Incorporated. Among the many reports that must be fi led with corporate headquarters is the annual...
-
5.a. Is the term representative democracy a contradiction, and, if so, why? (2 marks; word limit: 100 words).
-
Alice has invented a new card game to play with Bob. Alice made a deck of cards with random values between 1 and 52. Bob picks 5 cards. Then, he has to rearrange the cards so that by utilizing the...
-
The VP of Marketing of a large store finds sales declining inspite of increase in dollars spent on advertising and promotion. As market research professionals what would your advice be to him/her?
-
Izabella is 20 years old. Eighteen months ago, she started selling some of her old clothing which no longer suited her on peer-to-peer social shopping apps such as Letgo and Depop. She was surprised...
-
https://hbswk.hbs.edu/item/rethinking-business-strategy-in-the-age-of-ai Provide an overview of the case. Analyze at least two concepts from the chapters that pertain to the case. Explain what should...
-
You have been asked to determine the NPV of a project. The has a cost of $800. This cost is incurred at year O. The expected cash flow in year 1 is $130. The expected cash flow in year 2 is $220. The...
-
Where on the HHI index would an industry with five companies with the following market shares be categorized? Firm A 24% Firm B 23% Firm C 20% Firm D 15% Firm E 18%
-
You have just received a bonus of 15,000 euros and have decided that you want to invest the money. After discussing your options with your bank, you have narrowed it down to two options: A. A savings...
-
E(CF1) = 1,000*0.4 2,000*0.5 4,000*0.1= 1,800. E(CF2) = 1,500*0.3 2,000* 0.6 6,000* 0.1 = 2,250. E(CF3) = 3,000* 0.2 3,000 * 0.4 5,000*0.4 = 3,800. E(NPV) = -4,000 1,800/1.1 2,250/1.12 3,800/ 1.13 =...
-
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) =...
-
Calculate the correlations among all numeric variables in Exercise 9.1 using SPSS, or R. (In R read in the data as a data.frame (e.g., theData) and then use (cor(theData). You dont need to attach...
-
Using one of the online calculators, how large a correlation would you need for the relationships shown in Exercise 9.2 to be significant? (This will involve a bit of trial and error.) Calculate the...
-
What are the strongest single predictors of infant mortality in Exercise 9.2? Exercise 9.2 Calculate the correlations among all numeric variables in Exercise 9.1 using SPSS, or R. (In R read in the...
Study smarter with the SolutionInn App