Anyone knowledgeable with the language Java? I need help with writing a program that got to do with arrays & strings & File I/O.
You have been asked to read a text file word by word, and then sort the words in alphabetical order, and save them in sorted order in another file with following specifications:
1. Prompt user to input for file names.
2. Estimate the number of the words in the file, and then create an array of String such as String[] words = new String [ESTIMATED_SIZE] and store words in the array.
3. Change all world to lower case.
4. If words have a punctuation symbol in the beginning or at the end of the words, then remove the punctuation marks from the word, and keep the word.
5. You need to remove the following punctuation marks from each word; [ '.' (dot), ',' (comma), ';' (semi-colon), ':' (colon), '?' (question mark), '!' (exclamation), ' " ' (double quotation), ' \' ' (single quotation) , ')' (opening parentheses) , and '(' (closing parenthesis )].
6. If words still have any symbol except '-' (hyphen), then ignore the words.
7. Get rid of the words that contain digits.
8. Get rid of spaces from both side of the words.
9. Save the file in unique order. If there are many occurrences of the same word, then save only one of isntance of the word.
Check the sample
input file and
output file.