A console-based Library Management System built in C++ using Object-Oriented Programming (OOP), featuring book inventory management, member registration, book issuing/returns, overdue tracking, and file-based data persistence.
This project was developed during my 2nd Semester at Bahria University Islamabad as part of the Computer Programming course. It simulates a real-world library system with separate access levels for administrators and members, and is preserved on GitHub to document my progress and showcase my growth as a Computer Engineering student.
| Module | Functionality |
|---|---|
| 🔐 Admin Authentication | Password-protected access to the administrator menu (3 attempts) |
| 📖 Book Management | Add, remove, search, modify, and display all books |
| 👥 Membership Control | Add, remove, search, modify, and display all members |
| 🔑 Member Authentication | ID + password login for members before issuing/returning books |
| 🔄 Issue & Return | Issue books to members and process returns, with automatic quantity updates |
| ⏰ Overdue Tracking | Check and list all currently overdue books with due dates |
| 💾 File Handling | Persistent storage via bookRecords.txt, memberRecords.txt, and dueDates.txt |
Library
Management
System
Press Enter key to continue
========================================
MAIN MENU
========================================
1. Issue a book
2. Return a book
3. Administrator menu
4. Quit the program
========================================
Enter Your Choice : (1-4) :
"ADMINISTRATOR MENU"
========================================
1. Add a new book
2. Remove an existing book
3. Display all books
4. Search for a specific book
5. Modify a book
6. Membership Control menu
7. Check overdue books
8. Back to main menu
========================================
Enter your choice (1-8) :
A quick reference for the ID/password formats the system expects:
| Field | Format | Example |
|---|---|---|
| 📕 Book ID | B + 3-digit number |
B001, B045, B097 |
| 🎓 Member ID | Bahria enrollment format | 09-132242-032 |
| 🔑 Member Password | Free-text, set by the member at registration | (custom, chosen by member) |
| 🛡️ Admin Password | Fixed credential defined in source (adminPassCheck() in lms.cpp) |
(hardcoded — not stored in a file) |
💡 Member IDs and passwords are stored in
memberRecords.txt, while the admin password is set directly in the source code rather than read from a file.
- Language: C++
- IDE: Visual Studio 2022
- Concepts: Object-Oriented Programming (Classes:
book,member) · File Handling (fstream) · String Manipulation (sstream,stoi) · Date/Time Handling (ctime) · Console I/O (conio.h)
Library-Management-System/
├── 📄 lms.cpp # Core application logic (book & member classes, menus)
├── 📄 bookRecords.txt # Book inventory data (auto-updated)
├── 📄 memberRecords.txt # Member registration data (auto-updated)
├── 📄 dueDates.txt # Issued book due dates (auto-updated)
└── 📄 README.md
1. Clone the repository
git clone https://github.com/muhammadshoaib-ce/Library-Management-System.git2. Open in Visual Studio 2022
File → Open → Folder/Project → lms.cpp
3. Build & Run
Ctrl + Shift + B → Build Solution
Ctrl + F5 → Run without Debugging
⚠️ Make surebookRecords.txt,memberRecords.txt, anddueDates.txtare in the same directory as the compiled.exe
- ✅ Implementing Object-Oriented Programming with classes for real-world entities
- ✅ Designing multi-level menu systems (Main → Admin → Membership)
- ✅ Building authentication flows with limited login attempts
- ✅ File I/O (
fstream) for persistent storage across program runs - ✅ Managing relational data across multiple text files (books, members, due dates)
- ✅ Handling dates and overdue logic using
ctime
- 🔹 Refactor file handling into a dedicated data-access layer
- 🔹 Add fine calculation for overdue books
- 🔹 Replace flat text files with SQLite or MySQL database
- 🔹 Add book categories and advanced search filters
- 🔹 Encrypt stored passwords instead of plain text
- 🔹 Build a GUI using Qt or a web front-end
Muhammad Shoaib Computer Engineering Student — Bahria University, Islamabad
⭐ Star this repo if you found it helpful!