P5.Summer2007

P5.Summer2007 - Program #5 COP 2551 Summer 2007 Note: This...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Program #5 COP 2551 Summer 2007 Note: 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. . Background : Consider program in your text at the end of Chapter 8 on Inheritance. It reads: 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. Overview: 1. Create your own input file from data provided below. Using data provided below, you are to build your own input file called books.txt 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. 2. 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. You 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.) 3. Display the three arrays . After building the three arrays, you are to display each of these lists. Each list is to have a very nice ‘header,’ skip a line, and print the entries in
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
‘that’ array very nicely formatted, that means columns that line up, etc. (single space these entries). In a little more detail, you will need to access the external file, read in records, access
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/26/2011 for the course COP 2551 taught by Professor Roggio,r during the Summer '08 term at UNF.

Page1 / 6

P5.Summer2007 - Program #5 COP 2551 Summer 2007 Note: This...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online