Example 8

Library

Use a linked list with two types of links to store library books that are sorted based on first author name using the first link and are sorted based on ISBN number using the second link.

Class Author holds the author's first & last names, as well as their nationality.  Accesor methods provide last name and nationality of an author object.

Class Book holds data about the book including title, publisher, year, edition, ISBN, and subject area.  Book also has an author array which allows up  to 5 separate authors to be listed. 

Class BookLink holds a Book object, as well as a count  of the number of books in the library, and two links.   One of the links points to the next author in alphabetical  order, while the second link points to the next book in  ISBN order.  The functionality of the class BookLink includes checkAuthorLastName method  that returns  a boolean value of true if the last name passed to  the method matches any of the book authors' last  names. Method should be written in such a way that it is not case sensitive.  Method increaseNumberOfBooks  adds the specified  number of books to the value of numberOfBooks. Accessor methods provide class data.

Class LibraryApp uses the BookList class to manage a  linked list of books and how many of each book   the library owns. This class also interacts with the user  through the console using the Keyboard class.