reading,sorting,displaying data from a text file
How do i accomplish the task below using java. Please include code.
Consider a text file which contains a minimum of 20 english sentences one per line. You are required to write a program which will list the first three words which have the highest frequency of use and the three words with the lowest frequency of use. eg. if the words in a text file had the following frequency of use as shown below
Time table - 4
security - 2
projector - 3
monday - 10
morning - 7
classroom - 5
cleaner - 6
director - 1
lecturer - 2
evening - 8
the program should produce an output such as:
Words with highest frequency of use:
Words with the lowest frequency of use:
note: the words with the same frequency of use are listed in alphabetical order. Assume that all the words in the text file are in lower case and are seperated by one or more spaces.
Maybe if you offer money someone will do it all for you, but you won't learn anything. As I said in the other post, tell us specifically what it is you're having trouble with and someone will help.
Check out the static method Collections.sort() and
the Comparable interface.\, and java.io.BufferedReader
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center