Django Scenario
Django Scenario
You need
to create a Python program that can handle various operations related to books,
such as adding new books, searching for books by title or author, and calculating
late fees for overdue book returns.
To complete this project, you will need to demonstrate your understanding of the
following concepts:
Python Syntax: Use proper Python syntax to define variables, functions, and
control structures (e.g., loops, conditional statements).
Module Importing and Exporting: Create separate Python modules for different
functionalities, such as book_operations.py and fee_calculator.py. Import and use
the functions defined in these modules within your main program.
Object-Oriented Programming:
Define a Book class with attributes like title, author, publication_year, and
methods like display_info().
Create a Library class that manages a collection of Book objects. It should have
methods to add new books, search for books, and calculate late fees based on
the number of days a book is overdue.
User Interaction:
Provide a user interface (console-based or GUI) where users can interact with
your program, such as adding new books, searching for books, and calculating
late fees.
File I/O:
Store and retrieve book information from a file (e.g., CSV, JSON) or a database
(e.g., SQLite).
Step 1: Define the Book class
● In the same book.py file, create a subclass called ReferenceBook that inherits
from the Book class.
● Add an additional attribute called edition to the ReferenceBook class.
● Override the display_info method to include the edition information when printing
the book's details.