Consider a typical library system described in the following case study.
A member of the library is issued with a membership card. Whenever the member wants to borrow a book (up to 6 books can be on loan to a member), the card has to be used.
Books can be borrowed for 14 days and if they are not returned on time, a fine is charged.
If the book has not been returned by a week, reminders are sent out. After the third reminder the member is put on a blacklist until the books have been returned and the fines paid.
Up to 8 copies of popular titles may be held in the library. Books can be reserved if no copies are available for loan. A note is made of the book title, author or authors and the member card number. Members are notified when the title is available.
Create a suitable singly-linked list (SLL) data type to store reminders. Write an algorithm to insert a reminder element:
Write a Java application to test your algorithm.
The Reminder class may implement the following interface type:
public interface ReminderItem {
public void setDescription (String value); public String getDescription( );
public int getId( );
public void setId(int id);
public Date getReminderDate( );
public void setReminderDate (Date d);
}
As part of an Information System for the library, it is required to send reminders for books not returned on time. Write an array based queue for storing reminders. Write a Java application to test the queue.
Explain how a Binary Search Tree may be used as part of an Information System for the library. As part of your answer, illustrate how such a tree may be populated.