I already created a word class that is needed for the wordprocessing
Java Code:
public class Word {
	
	private String word;
	private int count;
	
	//defult constructer
	public Word(String word) {
		this.word = word;
		count = 1;
	}
	//gets the word and return the string value
	public String getWord() {	
		return word;
	}
	//returns the count for each word read
	public int Count() {
		return count;
	}	
}
(I'm not asking for someone to do it for me or someone to do my homework for me. I need help on exactly what I need to do, some code would be helpful. I'm just plain stuck)
This is what I need to do :
1. Prompts the user for and reads the name of the input text file.
2. Method, String makeOutFile(String) : accepts the input file name and produces a new string to
be used as the output file name. This method should take the input parameter and change the
extension to "out". So, if the user enters the input file name, test.txt, your code should create an
output file named, test.out. Close the input file when you have completed reading and close the
output file when you have completed writing.
3. In addition to the title at the beginning of the program and the prompt for the input file name,
display to the screen identification of the different steps happening during the processing.
Since there is no other output to the screen, this is helpful in identifying the progress of the
program. For example, you would let the user know the progress being made by displaying
messages such as:
Counting words
Sorting words
Printing words
Printing statistics
Program complete
4. Use an array of Word objects to hold the data. Your main method will declare an array of these
Word objects.
5. Declare the Word array in main and pass it as a parameter to the other methods. Declaring the
array as a static global is not acceptable.
6. You may not assume a maximum number of unique words. Begin by making your array of
Word objects to contain 100 elements. If the application needs to store more Word objects,
then a method should be provided to enlarge the array. See under WebCT/Examples:
StudentProcessor.java.
7. Break your code into meaningful methods that are short and perform only one task. Methods
must not contain more than 25 statements.
8. Here is an algorithm for the application to read the input file and count occurrences of words:
while not end of file
read a word from file
set position to the result of searching for the word in the array
if the word is in the array
increment the count at the position where the word was found
else
add the word to the end of the array and set its occurrence count to 1
end while
9. Include the method, search: You must use a linear (sequential) search algorithm to determine
if a word is in the Word array. Remember that the array is an array of Word and that the key is
a String so the String comparison must be done. The search must be a separate method that
returns an integer value: the position in the array of the found item or ‐1. Do not use a for loop
and the method must have only one return statement.