Question
This is a small programming assignment using Javas HashSet data type and name it Books.java. The program will read words from two text files. Read
This is a small programming assignment using Javas HashSet data type and name it Books.java.
The program will read words from two text files. Read the words from one file, convert them to lower case, and put them into a HashSet
scanr.useDelimiter("('*[^a-zA-Z']'*|''+|^'|'$)+");
How many words were present in the first file that were not in the second file? How many words were present in the second file that were not in the first file? Putting all the words from the two files together, how many unique words were there in both files combined? (You can answer all of these questions using the HashSet API, without writing any loops.)
For example, here is the output:
File books/austin.txt contains 6346 unique words. File books/twain.txt contains 6089 unique words.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started