Question: This program is built on the Object Oriented Programming concept of Aggregation, where you build complex objects comprised of other objects. You will code 3

This program is built on the Object Oriented Programming concept of Aggregation, where you build
complex objects comprised of other objects.
You will code 3 classes. The Student class, which uses the Library which consists of Books. There is not
any inheritance in this project.
The Book class.
Attributes in __init__: title, isbn, author. Make these attributes non-public.
Use @property to make all of these read-only attributes. (No setter methods these attributes
cannot be modified.
Method: displayBook. This method should consist of a print statement that prints the title, author
and isbn of the book. (see Example)
The Library class.
Attributes in __init__: Takes an argument list_of_books. This is assigned to an attribute:
available_books. Another attribute called list_of_borrowed_books is initialized to an empty list.
Method 1: displayAvailableBooks. No arguments. This method will process the list of available
books and print all the books in the list using the method in the Book class.
Method 2: lendBook. Argument: requested_book_title. This method will check to see if the
requested_book_title is in the available_books. If so, then it will let you know you can borrow it and
then remove the book from the available_books and place it in the borrowed_books.
Method 3: addBook. Argument: returned_book_title. This method will check to see if the
returned_book_title is in the list of borrowed books. If so, then it will add that book to the available
books list and remove it from the borrowed books.
NOTE: For methods 2 and 3, you will need to use a loop to process the list. Include logic that will
alert the user if no action was taken.
The Student class.
Attributes: for simplicity, this class does NOT have an __init__ method, nor does it have any
attributes. Instead, it consists of two methods.
Method 1: requestBook. No arguments. The method asks the user to enter the title of the book
they would like to borrow and returns this title.
Method 2: returnBook. No arguments. The method asks the user to enter the title of the book they
are returning and returns this title.
In the main():
Create 4 different book instances.
Create a library instance and sent it a list of the books.
Create a student instance.
The following action exists inside of a while loop.
o Display a menu with 4 choices: Display the list of books, Request a book, Return a book,
Exit
o The user then enters their choice as an integer.
o Then in an if...elif... structure, depending upon the choice, fulfill the students request.
Different choices will require you to use methods in the Student class or in the Library
class, or both... make sure to make comments to understand easily

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!