Question: 9. A simple software system for a library models a library as a collection of books and patrons. A patron can have at most three

9. A simple software system for a library models a library as a collection of books and patrons. A patron can have at most three books out on loan at any given time. A book also has a list of patrons waiting to borrow it. Each book has a title, an author, a patron to whom it has been checked out, and a list of patrons waiting for that book to be returned. Each patron has a name and the number of books it has currently checked out. Develop the classes Book and Patron to model these objects. Think first of the interface or set of methods used with each class, and then choose appropriate data structures for the state of the objects. Also, write a short script to test these classes

 10.Develop a Library class that can manage the books and patrons from Project 9. This class should include methods for adding, removing, and finding books and patrons. There should also be methods for borrowing and returning a book. Write a script to test all these methods.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres an implementation of the Book and Patron classes in Python along with a script to test them class Book def initself title author selftitle title selfauthor author selfcheckedoutto None selfwaiti... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!