Question: Please come up with report based on phython programing in library Management System from given information. This report should provide Executive Summary, introduction, method and

Please come up with report based on phython programing in library Management System from given information. This report should provide Executive Summary, introduction, method and detail of each class and coding The primary objective of this application is to manage library operations, particularly focusing on the borrow
and return process for books.
Detailed Requirements
1. Book Class:
Properties:
Title
Author
ISBN
Availability status
Methods:
Constructor to initialize the four key properties.2. User Class:
Properties:
UserID
Name
List of borrowing history
List of current history
Total fines
Methods:
Constructor to initialize the five key properties.3. Checkout Class:
Properties:
List of borrowed books
Due dates
Total fines
Methods:
1. Default constructor to initialize a new LibraryCheckout object.
2. borrow_book(some_user, some_book): Method to handle the borrowing of a book.
3. return_book(some_user, some_book): Method to handle the return of a borrowed book.
Assume $1 fine per day
4. print_receipt(some_user): Method to print a receipt of the transaction.
rom datetime import datetime, timedelta
# Book Class
class Book:
def __init__(self, title, author, isbn, availability=True):
self.title = title
self.author = author
self.isbn = isbn
self.availability = availability
def __str__(self):
return f"'{self.title}' by {self.author}(ISBN: {self.isbn})"
# User Class
class User:
def __init__(self, user_id, name):
self.user_id = user_id
self.name = name
self.borrowing_history =[] # To store all borrowed books (including returned)
self.current_books =[] # Books currently borrowed by the user
self.total_fines =0.0 # Track the user's total accumulated fines
def borrow_book(self, book):
# Adds a book to the user's current borrowed books
self.current_books.append(book)
def return_book(self, book):
# Removes a book from current borrowed list and adds it to borrowing history
if book in self.current_books:
self.current_books.remove(book)
self.borrowing_history.append(book)
def add_fine(self, amount):
# Adds a fine to the user's total
self.total_fines += amount
def __str__(self):
return f"User: {self.name}, ID: {self.user_id}, Total Fines: ${self.total_fines:.2f}"
# LibraryCheckout Class
class LibraryCheckout:
def __init__(self):
self.borrowed_books ={} # Stores books and their due dates
def borrow_book(self, user, book):
if book.availability:
due_date = datetime.now()+ timedelta(days=14) # 14-day loan period
self.borrowed_books[book]= due_date
book.availability = False
user.borrow_book(book)
print(f"Book {book} borrowed by {user.name}. Due on {due_date.strftime('%Y-%m-%d')}")
else:
print(f"Book {book.title} is currently unavailable.")
def return_book(self, user, book, return_date=None):
if book in user.current_books:
due_date = self.borrowed_books.pop(book, None)
user.return_book(book)
book.availability = True
# If return_date is None, use current date (real-time return)
if not return_date:
return_date = datetime.now()

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!