P6.Fall2005 - Program#6 COP 2551_706 Fall 2005 Note This...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Program #6 COP 2551_706 Fall 2005 Note: This program will be run using the JGrasp IDE in a Windows environment. This will use: STRINGTOKENIZER; EXTERNAL FILES; ARRAYLIST OF STRINGS AND OBJECTS. ITERATORS, EXCEPTION HANDLERS Objectives: 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 (optional; extra credit) To gain more experience with UML and program design using classes . 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. 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 : Using records from an input file that you create (records provided ahead), you are to create three arrays of objects. 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 errors. In this case, you will need to catch these exceptions and process them accordingly (ahead). (You may remove the two records containing errors, if you wish. Exception processing may be undertaken for extra credit.). If this is your choice, then the file you create should contain no errors dealing with the data itself. No editing of input fields will be necessary. Of course, any I/O can generate an IOException,, as you are aware from Program #5.
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern