This program will be run using the JGrasp IDE in a Windows environment.
This will use: STRINGTOKENIZER;
ARRAYLIST OF STRINGS AND
OBJECTS. ITERATORS, EXCEPTION HANDLERS
Gain additional experience using multiple classes
To gain experience with sorting objects
To gain additional experience processing arrays of objects
To gain experience with inheritance
To gain experience using abstract classes
To gain experience using polymorphism
To gain experience with Exception Handlers
To gain more experience with UML and program design using classes
Consider program in your text at the end of Chapter 8 on Inheritance.
Design and implement a set of classes that define various types of reading material:
magazines, technical journals, textbooks, and so on.
Include data values that describe various attributes of
the material, such as the number of pages and the names of the primary characters.
Include methods that
are named appropriately for each class and that print an appropriate message.
Create a main driver class to
instantiate and exercise several of the classes.
We will use this basic thinking to define a closely related programming assignment that is a bit more
challenging and include some materials from Chapter 10 on exception handling and reading text files.
Using records from an input file that you create (records provided ahead), you are to create three arrays of
Each array of objects are arrays of different types of books.
You are to display each of these lists,
sort each array of objects, and then display the arrays of types of books again.
In a little more detail, you will need to access the external file, read in records, access individual fields,
determine the appropriate array the input data should be put into, build the arrays of different types of
books, sort them based on author, and display these lists with appropriate headers.
If you elect to
accommodate the Exception processing, your input stream will contain a couple of records containing
In this case, you will need to catch these exceptions and process them accordingly (ahead).
may remove the two records containing errors, if you wish.
Exception processing may be undertaken for
If this is your choice, then the file you create should contain no errors dealing with the data
No editing of input fields will be necessary.
Of course, any I/O can generate an IOException,, as
you are aware from Program #5.