, , , , , , , , , , , ,

[SOLVED] Cs 212 project 4 frequency count of words write a program that will read from a file and display

$25

File Name: Cs_212_project_4_frequency_count_of_words_write_a_program_that_will_read_from_a_file_and_display.zip
File Size: 904.32 KB

5/5 - (1 vote)

Write a program that will read from a file and display to the console all the words in the file in
alphabetical order along with the number of times each word appeared in the file. For example, if the
input file is:
This is an example, of an input file
for project four, as an example.
The output to the console would be:
an – 3
example – 2
file – 1
for – 1
four – 1
input – 1
is – 1
of – 1
project – 1
This – 1
To get the individual words from each line of the file use a regular expression (perhaps with the split
method of class String) as shown in lecture. Note that the input file may contain reasonable punctuation
marks separating the words.Use a TreeMap to store the words and their counts (that is, TreeMap <String,Integer>)
You will need to use the wrapper class Integer to hold the count of the words as TreeMaps do not store
primitives.Allow the user to select the input file using a JFileChooser.
Since this project can be done with one class, you do not need to create a jar file. You can submit the
file Project4.java to Blackboard. Make sure you upload the correct file by the due date (which is also the
cutoff date) as there will be no opportunities for resubmission of projects.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] Cs 212 project 4 frequency count of words write a program that will read from a file and display
$25