Assignment 9 - Due Wednesday March 31 23:59 by e-mail

File I/O and Sorting

Study the Text Analyzer presented in your text on page 344 (case study 13.1).

Then write a program (Homework9.java) that

and which
Notes:

  1. You can use any sorted method you want. Selection sort (also called exchange sort) was mentioned in class as the simplest method (it appears on page 194 in the textbook). But you can use bubble sort or quicksort or another sorting method that you prefer.

  2. Make sure you account for the unknown number of integers in the file. In class we mentioned that using a Vector to store the integers is a flexible way of reading the numbers in from the file. If you use arrays make sure you can accommodate any file size without taking up more memory than you need. So using Vectors is encouraged.

  3. The example program uses StreamTokenizer. The behavior of the objects of this class is similar to StringTokenizers. These kind of objects are fully customizable but we will use them in their default setting, in which the delimiters are space, newline, tab, and carriage return.

  4. We will grade these programs by running them on various test files that will be created with text editors.