Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Sorting the file in java You have been asked to read a text file word by word in an array of Strings, process the words,

Sorting the file in java

image text in transcribed
You have been asked to read a text file word by word in an array of Strings, process the words, sort the words in alphabetical order, and save them in sorted order in another file with following specifications: 1.Prompt user input for file names, input file name and output file name. 2.Count number of the words in the file, and then create an array of String with size equal to the number of the words in the file. 3.Reopen the file, read, and store each word of the file in the array. 4.Change all world to lower case. 5. Print number of the words, and frequency of each letter ('a' to '2'), ignore cases, on the screen. 6.If words have any non-letter symbols in the beginning or at the end of the words, then remove them from both sides of the words. If still word contains any other non-letter symbol except hyphen then get ride of the word, otherwise keep it. 7. Sort the words in alphabetic order. 8. Save the words in a file in a unique order. If there are many occurrences of the same word in the array, then save only one instance of each word

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

What steps do I need to take to compute this? What do I type in? \f

Answered: 1 week ago