This program will be run using the NetBeans 5.5 IDE in a Windows environment.
This will use: StringTokenizer or substring, external files, the ArrayList Class,
multidimensional arrays, and exception handlers.
This program will also provide
practical issues with inheritance, polymorphism, and also affords additional UML and
pseudocode design practice.
If you choose to include exception handling, there will be a
twenty point bonus!
See details below.
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:
books, novels, 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.
(some of these might be in a base class, while other
attributes might be in derived classes.)
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.
Create your own input file from data provided below.
Using data provided below, you are to build your own input file called
and place it into your project directory.
More ahead, but the first character of each format
tells the ‘type’ of book / manuscript that the following text represents.
You will use this
in 2 ahead.
Build arrays from this input file
Using records from an input file that you created
in the previous task, (records are provided ahead), you are to read the single input file you
create, and from this file create three arrays of objects, one for each type of book.
are to pass the input file (that is, ‘read’ the input file) only one time.
Each record is to be
examined to determine the type of record it is, and to determine which of the three arrays
the object you create will be placed in.
(You may need StringTokenizer or substring or
other methods / classes as you may determine.)
Display the three arrays
After building the three arrays, you are to display each of
Each list is to have a very nice ‘header,’ skip a line, and print the entries in