This project implements a simple Library Management System in C++. Features: Add, search, issue, return, list, and delete books. File handling for persistent data storage. User-friendly command-line interface for interaction.Technologies Used: C++, file handling, object-oriented programming.
This project implements a simple Library Management System in C++. It allows librarians to manage books by performing operations such as adding new books, searching for books by title or ID, issuing and returning books, listing all books, and deleting books from the system. Data is stored persistently in a file (library_data.txt
), ensuring that information is retained between sessions.
- Add new books with ID, title, and author.
- Search for books by title or ID.
- Issue books to mark them as issued.
- Return books to mark them as available.
- List all books in the library.
- Delete books from the system.
- C++ compiler (e.g., g++) installed on your system.
- Ability to compile and run C++ programs from the command line.
- Basic understanding of C++ programming.
- Terminal or command prompt for executing the program.
- Clone the repository:
- Navigate to the project directory:
- Compile the program:
- Run the executable:
- Follow the on-screen instructions to interact with the Library Management System.
The source code (LMS.cpp
) contains the implementation of the Library Management System. It includes classes for Book
and Library
, functions for managing books, and file handling for data persistence.
- addBook(Book book): Adds a new book to the library.
- searchBookByTitle(string title): Searches for a book by its title.
- searchBookById(int id): Searches for a book by its ID.
- issueBook(int id): Issues a book to mark it as issued.
- returnBook(int id): Returns a book to mark it as available.
- listAllBooks(): Lists all books currently in the library.
- deleteBook(int id): Deletes a book from the library.
- loadFromFile(const string& filename): Loads book data from a file for persistent storage.
- saveToFile(const string& filename): Saves book data to a file for persistent storage.
Contributions are welcome! If you have suggestions or improvements, please fork the repository, create a new branch, and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.