In this chapter, we built a library management system made up of the classes Book
, Customer
, and Library
.
The Book
class holds information about a book. Each Book
object holds a unique identity number. It also keeps track of the borrower (if the book is borrowed) and a list of reservations. In the same way, the Customer
class holds information about a customer. Similar to the book, each customer holds a unique identity number. Each Customer
object also holds a set of borrowed and reserved books. Finally, the Library
class provides a set of services, such as adding and removing books and customers, borrowing, returning, and reserving books, as well as displaying lists of books and customers.
In this chapter, each book and customer have a unique identity number. In the next chapter, we will look into to the library system again. However, we will omit the identity numbers and work with pointers instead.