Pick one of the following problems to do for your interclass problem.

1. Text Counting - For the spreadsheet we learned how to read text files. In that case we wanted to bring in a CSV file because they are good for spreadsheet type data. For this I want you to add two methods to the Spreadsheet class. Both are simpler than reading a CSV file but will test your ability to read files. The two methods are int countLines(String fileName) and int countWords(String fileName). They shoud pretty much do what their names imply. The string that gets passed in is the name of the file you want to read.

2. Business Decisions - This problem has you working with this CSV file. This is for a spreadsheet with five columns and each one has 15 rows. The first four columns are numbers of items sold of each of four different types. The last column is total sales. I want you to write a method that returns the average of total sales for those entries where the value in one column is larger than another. The method will take two parameters that are column numbers. You only average costs where the first column has a larger value than the second column.

3. Improved Min - Take the min method that we wrote in class and make it so that it doesn't crash if there are empty cells.

4. Standard Deviation - Put in a method that will calculate the standard deviation of the values in a column. The standard deviation, also called the root-mean square, is the square root of the means of the squares of the deviations of the values from the average. To find it you first find the average, then run back through the values and add up the squares of the deviations. If the average is ave, the deviation of x is (x-ave) and you want to add up (x-ave)*(x-ave) for all the x values in the column. Once you have that sum you divide by the number of elements and take the square root of that using Math.sqrt(). Your code for this can be written so that it doesn't allow blanks in the column.

5. Median - Write a method that will return the median of the values in a column. You can write it so that it doesn't allow blanks. The easiest way to do this is to sort the values and then pick the one in the middle. If you get all the values into an array you can sort them using java.util.Arrays.sort. (Call Arrays.sort after you have imported java.util.*.) So this method should make an array double doubles (double[]) and put values in it, then pass that to Arrays.sort and return the middle value in the array.

6. Ascending Order - For this I want you to write a method that will sort the values in a column and put them back in ascending order. This code does not have to work with blank elements. Use the sort method described above to sort an array of values, then use the set method to put them back into the table. After you have done that call renderTable() so that the new numbers show up.