What to submit: (i) Printout of output from 5 runs of the original program, (ii) a 2-3 sentence write-up for the second part of the problme, and (iii) Printout of output from 5 runs of the modified program.
To read from the file, you can start by building a BufferedReader object as follows.
BufferedReader in = new BufferedReader(new FileReader("words.dat"));
Then you can use methods from the BufferedReader class (e.g., readLine) to read from the file. You might want to consult documentation for the BufferedReader class.
What to submit: Call your program wordCount. So you should be submitting a file called wordCount.java that defines a class called wordCount. You should also submit a printout of the output of this program.
Record rangeSearch(double pay1, double pay2)This method returns an array of records corresponding to all employees whose salaries are between pay1 and pay2 (inclusive of pay1 and pay2). The size of this array should be exactly equal to the number of employees whose salaries are in the specified range.
What to submit: A printout of just the new method rangeSearch.
Think of various different situations that might affect the performance of rangeSearch and test these separately. For example, you should test for the situation in which there is no employee in the selected range. Another example, is the situation in which the entire set of employees is in the selected range. There are several other distinct situations that I can think of.
Write a paragraph listing all of the situations that you tested for.
What to submit: (i) A printout of the program RangeSearchTest, (ii) a printout of the output of RangeSearchTest, and (iii) a printout of your paragraph long write-up enumerating all the cases you tested.