Use the ArrayList, and TreeSet to solve a specific problem create a class named
ID: 3626204 • Letter: U
Question
Use the ArrayList, and TreeSet to solve a specific problem
create a class named ListTreeSet that performs the following operations on the contents of a text file containing the address given by President Abraham Lincoln at Gettysburg, Pennsylvania 19 November 1863:
1. Tokenize the address into individual words and allow display to the screen (use a delimiter when reading the file).
2. Allow reporting of the total number of words in the address.
3. Sort the words of the address while removing duplicates words then display to the screen.
4. Report the number of duplicate words found in the original address.
5. Search the original address for the word “brave” (without quotes) and report its word position within the address.
6. Display the entire address token-by-token, reversed.
All of these operations must be exercised by the “user” class main method. The user class should perform the displaying of data provided by your ListTreeSet class. Your ListTreeSet class should NOT display anything.
Explanation / Answer
hi there i have this is the solution for number 6 and u can modify it to do the rest i did number 6 cause i think it is the hardest one ask me :) this program open a file takes the lines in the file count the words the lines and print them reversely so u can modify the counting for words to search for the duplicate word and for the word brave hope this will help u out to do something #include #include #include #include using namespace std; ifstream myfile; void print(string ); void print_reverse(string ); int main() { string filename; coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.