17.7k views
1 vote
Suppose you are the librarian of a small-town library and you want to create a program to help you manage your collection of books. Each book has a unique 4-digit ISBN code known as bookID, and you want to use a linked list to store and manage the books. Please note that you are provided with template (code) files, which are Book.java, LibrarySystem.java, Node.java; students are expected to use these files to aid with this question. Question 1. Creating the Books

1. Create a class called Book with the following attributes/variables:
a. String title-Title of the book
b. String author - Author of the book
c. String publisher - Publisher of the book
d. int bookID

1 Answer

4 votes

Final answer:

To manage book collections, a Book class with title, author, publisher, and bookID is created and used with a linked list for organization.To manage a library collection, start with a Book class defining title, author, publisher, and bookID. Use linked lists for organization.

Step-by-step explanation:

To create a program for managing a collection of books in a small-town library, one would begin by creating a Book class with attributes that include the book's title, author, publisher, and a unique bookID. The LibrarySystem would then utilize this class in conjunction with a linked list to organize and manage the books.

For example, a Book class in Java could be defined as follows:

public class Book {
String title; // Title of the book
String author; // Author of the book
String publisher; // Publisher of the book
int bookID; // Unique 4-digit identifier

// Constructor and other methods...
}

After defining the Book class, the librarian can integrate the nodes of the linked list where each node contains a Book object. By doing so, the librarian can easily add, remove, and look for books using bookID as a reference point.