https://github.com/shadowwphoenix/library-management-system
This Java project is a simple library management system allowing users to borrow, return, view books, search by author/title/code/subject, and add books to a cart for borrowing. It utilizes queues for user and cart management, with a basic console interface.
https://github.com/shadowwphoenix/library-management-system
Last synced: 8 months ago
JSON representation
This Java project is a simple library management system allowing users to borrow, return, view books, search by author/title/code/subject, and add books to a cart for borrowing. It utilizes queues for user and cart management, with a basic console interface.
- Host: GitHub
- URL: https://github.com/shadowwphoenix/library-management-system
- Owner: ShadowwPhoenix
- Created: 2024-01-30T15:19:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-30T15:22:23.000Z (over 2 years ago)
- Last Synced: 2025-02-17T23:42:48.973Z (over 1 year ago)
- Language: Java
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This project is a simple implementation of a library management system. Let's break down the components and functionality:
Components:
Node Class: This class represents a node in a linked list. It holds information about a book such as its name, code, author, type, availability, and a reference to the next node.
Library Class: The main class that orchestrates the library management system. It contains methods for adding books, borrowing books, returning books, displaying available books, searching for books, managing a user queue, managing a cart queue, and a main method to run the program.
Functionality:
Adding Books (addBook method): Allows the addition of books to the library. Each book is represented as a node and added to the linked list.
Borrowing Books (borrow method): Allows users to borrow books from the library. It checks if the book is available. If it's available, the book is marked as borrowed. If not, the user is added to a queue to wait for the book.
Returning Books (Return method): Enables users to return books to the library. It marks the book as available for others to borrow.
Displaying Available Books (displayBooks method): Shows the list of books available in the library.
Searching for Books (searchBook method): Allows users to search for books based on different criteria such as author, title, code, or subject. Users can add searched books to their cart for borrowing.
Managing User Queue (addToUserQueue method): Manages a queue for users who want to borrow books that are currently unavailable.
Managing Cart Queue (cart method): Manages a queue for books that users want to borrow. Users can add books to their cart and borrow them collectively.
User Interaction:
The program interacts with users through the console. It provides a menu-driven interface where users can choose options such as borrowing, returning, viewing available books, searching for books, viewing their cart, and leaving the system.
Main Method:
The main method initializes the library with some predefined books and starts the user interaction loop.
Additional Notes:
The system appears to support multiple users, handling situations where a book might be unavailable due to being borrowed by someone else.
The borrowing process includes adding users to a queue if the desired book is not available immediately.
The system offers flexibility in searching for books by different attributes like author, title, code, or subject.
There is a cart functionality allowing users to collect books they want to borrow before proceeding to borrow them.
Overall, this project provides a basic framework for managing a library's book borrowing system in a console-based environment. It's a good starting point for expanding into more complex features like user authentication, book reservations, due date tracking, etc., for a real-world library management system.