Java Console Application built with core Object-Oriented Programming (OOP) principles. Features a dual-role access system (Client/Employee) and robust data persistence using flat-file storage.
READ&LEARN is a library management solution designed to handle book inventories, user entrance permits, and loan records. The application demonstrates fundamental programming concepts such as class inheritance, array management, and complex File I/O operations in a console environment.
✅ Browse Inventory: View the full list of available books.
✅ Advanced Search: Search for specific books by title or category.
✅ Temporal Filtering: Find books published within a specific timeframe (year intervals).
✅ Self-Service Permits: Generate a library entrance permit (PermisIntrare).
✅ Stock Management: Add new books (Carte) to the system in real-time.
✅ Loan Processing: Create loan slips (FisaImprumut) with automatic stock availability check.
✅ Data Lookup: Search for specific permits or loan records by user name.
✅ Inventory Control: View detailed information including publishers and available copies.
The project is structured into 4 main classes to ensure a modular and organized code logic:
| Class | Responsibility |
|---|---|
| ReadandLearn | The main controller handling menus, file parsing, and user interaction. |
| Carte | Entity representing a book (Title, Author, Publisher, Stock, Category). |
| PermisIntrare | Manages library access data for visitors. |
| FisaImprumut | Handles the logic for borrowing books and recording return dates. |
The application uses local text files as a database substitute. All changes (adding books, creating permits, or loaning items) are automatically synchronized with these files:
1️⃣ Carte.txt – Stores the library's book inventory.
2️⃣ PermisIntrare.txt – Stores issued entrance permits.
3️⃣ FisaImprumut.txt – Stores all active and past loan records.
Technical Detail: The system uses
Scannerfor reading andOutputStreamWriterfor overwriting files, ensuring data is formatted correctly for subsequent sessions.
- Encapsulation: Using Getters and Setters within entity classes.
- File I/O: Reading from and writing to structured text files using
split()and parsing logic. - Validation: Checking for book availability before issuing a loan.
- Data Structures: Managing collections of objects using arrays.
- Console UI: Developing a nested menu system with
switch-caselogic.
- Ensure you have Java JDK installed on your machine.
- Clone this repository or download the source files.
- Place the
.txtfiles in the same directory as the.javafiles (or within the project root). - Compile and run the main class:
javac src/readandlearn/ReadandLearn.java java src/readandlearn.ReadandLearn