This assignment is to use your knowledge of Chap 1-14 to implement a user defined string class, MyString with all the necessary overloaded operators. So, its application can be used to count frequency of the terms of adjacent words in a text file. Your submission will follow the following example (partial code is provided here) in the header file:
Your program shall be able to let user enter file names and the number of adjacent words to be combined into a term. In the output file, the terms shall be sorted according to the descending order of the frequency. Within the same frequency, the terms shall be sorted according to the alphabetical order.
In this program, you need to use an array of MyString objects, linear search, and selection sort.
The following are three example runs using the same input file, terms.txt, and there are three respective outputs for terms containing a single word, two adjacent words and three adjacent words. They are result1.txt, result2.txt and result3.txt.
Comments
Leave a comment