Assignment 9 - Due Wednesday March 31 23:59 by
File I/O and Sorting
Study the Text Analyzer presented in your text on page 344 (case study
Then write a program (
- has a similar GUI, featuring:
- and a
- reads a file that contains an unspecified number
of integer values,
- sorts them in ascending order, and
- outputs them in the GUI's
- 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.
- 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.
- The example program uses
StreamTokenizer. The behavior of
the objects of this class is similar to
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.
- We will grade these programs by running them on various test files that
will be created with text editors.