COP3330 Programming Assignment 4 DuplicateRemover solved

$35.00

Category: You will receive a download link of the .ZIP file upon Payment

Description

5/5 - (1 vote)

Problem 1
Create a class called DuplicateRemover. Create an instance method called remove that takes a single
parameter called dataFile (representing the path to a text file) and uses a Set of Strings to eliminate
duplicate words from dataFile. The unique words should be stored in an instance variable called
uniqueWords. Create an instance method called write that takes a single parameter called outputFile
(representing the path to a text file) and writes the words contained in uniqueWords to the file pointed to
by outputFile. The output file should be overwritten if it already exists, and created if it does not exist.
Create a separate class called Application that contains a main method which illustrates the use of
DuplicateRemover by calling both the remove and write methods. Your input file must be called
problem1.txt and your output file must be called unique_words.txt. You will not receive credit if you
use different file names, as my graders will not modify your code to make it work with their test files.
Your program should work on any text file. The TA’s will provide their own version of problem1.txt when
they run your code.
Problem 2
Create a class called DuplicateCounter. Create an instance method called count that takes a single
parameter called dataFile (representing the path to a text file) and uses a Map of Strings to count how
many times each word occurs in dataFile. The counts should be stored in an instance variable called
wordCounter. Create an instance method called write that takes a single parameter called outputFile
(representing the path to a text file) and writes the contents of wordCounter to the file pointed to by
outputFile. The output file should be overwritten if it already exists, and created if it does not exist.
Create a separate class called Application that contains a main method which illustrates the use of
DuplicateCounter by calling both the remove and write methods. Your input file must be called
problem2.txt and your output file must be called unique_word_counts.txt. You will not receive credit if
you use different file names, as my graders will not modify your code to make it work with their test files.
Your program should work on any text file. The TA’s will provide their own version of problem1.txt when
they run your code.
2/22/22, 3:33 PM Programming Assignment 4
https://webcourses.ucf.edu/courses/1338999/assignments/6375477 3/6
Criteria Ratings Pts
2 pts
2 pts
2 pts
2 pts
2 pts
2 pts
2 pts
2 pts
2 pts
Problem 1: Problem 1 shall contain a public class called DuplicateRemover 2 pts
Full
Marks
0 pts
No
Marks
Problem 1: DuplicateRemover shall contain a method called remove 2 pts
Full
Marks
0 pts
No
Marks
Problem 1: Given a text file, dataFile, the remove method shall determine the unique
words contained in dataFIle and store those unique words in the associated
DuplicateRemover object
2 pts
Full
Marks
0 pts
No
Marks
Problem 1: The remove method shall terminate the program and alert the user when an
exceptional IO event occurs
2 pts
Full
Marks
0 pts
No
Marks
Problem 1: The remove method shall clean up any and all resources allocated during
method execution
2 pts
Full
Marks
0 pts
No
Marks
Problem 1: DuplicateRemover shall contain a method called write 2 pts
Full
Marks
0 pts
No
Marks
Problem 1: Given a text file, outputFile, the write method shall print the current collection
of unique words to outputFile
2 pts
Full
Marks
0 pts
No
Marks
Problem 1: The write method shall terminate the program and alert the user when an
exceptional IO event occurs
2 pts
Full
Marks
0 pts
No
Marks
Problem 1: The write method shall clean up any and all resources allocated during
method execution
2 pts
Full
Marks
0 pts
No
Marks
2/22/22, 3:33 PM Programming Assignment 4
https://webcourses.ucf.edu/courses/1338999/assignments/6375477 4/6
Criteria Ratings Pts
2 pts
2 pts
2 pts
2 pts
2 pts
2 pts
2 pts
2 pts
2 pts
Problem 1: Problem 1 shall contain a public class called Application 2 pts
Full
Marks
0 pts
No
Marks
Problem 1: Application shall contain a main method 2 pts
Full
Marks
0 pts
No
Marks
Problem 1: The main method shall create an instance of a DuplicateRemover called
duplicateRemover
2 pts
Full
Marks
0 pts
No
Marks
Problem 1: The main method shall use the write method of duplicateRemover to output
the unique words of “problem1.txt” to a file called “unique_words.txt”
2 pts
Full
Marks
0 pts
No
Marks
Problem 2: Problem 2 shall contain a public class called DuplicateCounter 2 pts
Full
Marks
0 pts
No
Marks
Problem 2: DuplicateCounter shall contain a method called count 2 pts
Full
Marks
0 pts
No
Marks
Problem 2: Given a text file, dataFile, the count method shall determine the number of
occurrences of each word contained in dataFIle and store each unique word and its count
in the associated DuplicateCounter object
2 pts
Full
Marks
0 pts
No
Marks
Problem 2: The count method shall terminate the program and alert the user when an
exceptional IO event occurs
2 pts
Full
Marks
0 pts
No
Marks
Problem 2: The count method shall clean up any and all resources allocated during
method execution
2 pts
Full
Marks
0 pts
No
Marks
2/22/22, 3:33 PM Programming Assignment 4
https://webcourses.ucf.edu/courses/1338999/assignments/6375477 5/6
Criteria Ratings Pts
2 pts
2 pts
2 pts
2 pts
2 pts
2 pts
2 pts
2 pts
4 pts
Problem 2: DuplicateCounter shall contain a method called write 2 pts
Full
Marks
0 pts
No
Marks
Problem 2: Given a text file, outputFile, the write method shall print the current collection
of unique words and their counts to outputFile
2 pts
Full
Marks
0 pts
No
Marks
Problem 2: The write method shall terminate the program and alert the user when an
exceptional IO event occurs
2 pts
Full
Marks
0 pts
No
Marks
Problem 2: The write method shall clean up any and all resources allocated during
method execution
2 pts
Full
Marks
0 pts
No
Marks
Problem 2: Problem 2 shall contain a public class called Application 2 pts
Full
Marks
0 pts
No
Marks
Problem 2: Application shall contain a main method 2 pts
Full
Marks
0 pts
No
Marks
Problem 2: The main method shall create an instance of a DuplicateCounter called
duplicateCounter
2 pts
Full
Marks
0 pts
No
Marks
Problem 2: The main method shall use the write method of duplicateCounter to output the
unique words of “problem2.txt” to a file called “unique_word_counts.txt”
2 pts
Full
Marks
0 pts
No
Marks
Problem 1 has been correctly uploaded to GitHub 4 pts
Full
Marks
0 pts
No
Marks
2/22/22, 3:33 PM Programming Assignment 4
https://webcourses.ucf.edu/courses/1338999/assignments/6375477 6/6
Total Points: 60
Criteria Ratings Pts
4 pts
Problem 2 has been correctly uploaded to GitHub 4 pts
Full
Marks
0 pts
No
Marks