A simple software system for a library models a library as a collection of books and patrons

A simple software system for a library models a library as a collection of books and patrons

 

watch this video to learn about how we can complete your assignments 

Exercise 1
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 to maintain the data/state of the objects. Also, write a driver program to test these classes.
Here is an example of a driver program:
from book import Book from patron import Patron
def main():
book1 = Book(“Of Mice and Men”, “Steinbeck”)
book2 = Book(“The Great Gatsby”, “Fitzgerald”)
book3 = Book(“1984”, “Orwell”)
book4 = Book(“One Flew Over the Cuckoo’s Nest”, “Kesey”) patron1 = Patron(“Ivan”)
patron2 = Patron(“Jimmy”)
patron3 = Patron(“Bob”)
book1.borrow(patron1)
patron1.addBook(book1)
book1.borrow(patron2)
book1.borrow(patron3)
book2.borrow(patron1)
patron1.addBook(book2)
book3.borrow(patron1)
patron1.addBook(book3)
patron1.addBook(book4)
book4.borrow(patron2)
patron2.addBook(book4)
print(“Book1 : ” + str(book1)) print(“Patron1: ” + str(patron1))
if name == ‘main‘: main()
and the associated output:
Can’t borrow more books–MAX REACHED! //This occurred when patron1 tried to add a 4th book Book1: Of Mice and Men, Steinbeck in care of: Ivan has 3 books
Waiting:

  1. Jimmy has 1 books
  2. Bob has 0 books
    Patron1: Ivan has 3 books

Do you have a similar assignment and would want someone to complete it for you? Click on
the ORDER NOW option to get instant services at LindasHelp.com. We assure you of a well
written and plagiarism free papers delivered within your specified deadline.

AD:

HQD CUVIE PLUS | FUME EXTRA  HQD CUVIE AIR  |  FUME INFINITY  FUME ULTRA  MORE XXL VAPE  HQD VAPE  CUVIE PLUS 

A simple software system for a library models a library as a collection of books and patrons

Exercise 1
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 to maintain the data/state of the objects. Also, write a driver program to test these classes.
Here is an example of a driver program:
from book import Book from patron import Patron
def main():
book1 = Book(“Of Mice and Men”, “Steinbeck”)
book2 = Book(“The Great Gatsby”, “Fitzgerald”)
book3 = Book(“1984”, “Orwell”)
book4 = Book(“One Flew Over the Cuckoo’s Nest”, “Kesey”) patron1 = Patron(“Ivan”)
patron2 = Patron(“Jimmy”)
patron3 = Patron(“Bob”)
book1.borrow(patron1)
patron1.addBook(book1)
book1.borrow(patron2)
book1.borrow(patron3)
book2.borrow(patron1)
patron1.addBook(book2)
book3.borrow(patron1)
patron1.addBook(book3)
patron1.addBook(book4)
book4.borrow(patron2)
patron2.addBook(book4)
print(“Book1 : ” + str(book1)) print(“Patron1: ” + str(patron1))
if name == ‘main‘: main()
and the associated output:
Can’t borrow more books–MAX REACHED! //This occurred when patron1 tried to add a 4th book Book1: Of Mice and Men, Steinbeck in care of: Ivan has 3 books
Waiting:

  1. Jimmy has 1 books
  2. Bob has 0 books
    Patron1: Ivan has 3 books

Do you have a similar assignment and would want someone to complete it for you? Click on
the ORDER NOW option to get instant services at LindasHelp.com. We assure you of a well
written and plagiarism free papers delivered within your specified deadline.

AD:

HQD CUVIE PLUS | FUME EXTRA  HQD CUVIE AIR  |  FUME INFINITY  FUME ULTRA  MORE XXL VAPE  HQD VAPE  CUVIE PLUS