JAVA PROGRAMMING Write a program that takes a commandline ar

JAVA PROGRAMMING

Write a program that takes a command-line argument representing a text file name. The program should read the given text file and print two lists, each in ascending order. One list should be the words that exist only once in the text file. The other list should be the words that appear more than once. Ignore the case of the words when determining whether a word has appeared more than once. Your program may ignore punctuation.

test.txt

I would not could not in the rain
Not in the dark Not on a train
Not in a car Not in a tree
I do not like them Sam you see
Not in a house Not in a box
Not with a mouse Not with a fox
I will not eat them here or there
I do not like them anywhere

Solution

Please find the required program along with its output. Please see the comments against each line to understand the step.

OUTPUT:

Single occurrence list:

anywhere
box
car
could
dark
eat
fox
here
house
mouse
on
or
rain
sam
see
there
train
tree
will
would
you

Non-single occurrence list:

a
do
i
in
like
not
the
them
with

JAVA PROGRAMMING Write a program that takes a command-line argument representing a text file name. The program should read the given text file and print two lis

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site