0 ratings0% found this document useful (0 votes) 18 views15 pagesJava OOp Project-1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Java OOP Project: Library Management System
Professor's Assignment Guide - Testing Java OOP Knowledge
Project Overview
This project is designed to test and enhance your understanding of Object-Oriented Programming (OOP)
concepts in Java. You will design and implement a Library Management System that incorporates key
principles such as Encapsulation, Inheritance, Polymorphism, and Abstraction. The project will simulate a
real-world library system where books and members are managed, and borrowing and returning
processes are automated.
Required Features
‘* Book Management: Add, remove, update, and search books by title, author, ISBN, and genre.
© Member Management: Register, suspend, and manage Student and Faculty members.
* Borrow & Return System: Borrow books, return books, calculate late return penalties, and manage
reservations.
Reports & Analytics: View available books, borrowed books, overdue books, popular books, and
member borrowing history.
* Authentication & Roles: Separate Admin and Member functionalities.
* Extra Features: Fine payment tracking, e-book links, export reports to file,
OOP Concepts to Demonstrate
* Encapsulation: Use private fields with getters and setters to protect data.
© Inheritance: Create a base Member class with StudentMember and FacultyMember subclasses.
«Polymorphism: Override methods to handle role-specific actions.
‘* Abstraction: Use interfaces such as Borrowable and Searchable to define behavior.
* Composition: Library contains a collection of Book and Member objects
Development Steps
* Step 1: Plan the class structure and relationships (Book, Member, Library, etc).
‘* Step 2: Implement the Book and Member classes with encapsulated fields
‘Step 3: Implement inheritance for different types of members.
* Step 4: Implement borrowing and returning functionality with validation.
* Step 5: Add reporting features and analytics methods.
* Step 6: Implement role-based authentication and access control.
* Step 7: Test the system with sample dataAssessment Criteria
* Correct use of OOP principles (Encapsulation, Inheritance, Polymorphism, Abstraction).
* Logical and efficient class design.
* Code readability and proper naming conventions.
‘Implementation of all required features
‘+ Handling of edge cases and error prevention.
* Creativity in adding extra features beyond requirements,
Deliverables
Submit your complete Java project as a ZIP file containing source code and a README file with
instructions on how to run the program. Include screenshots of the program in action and a brief
explanation of how OOP concepts were applied in your solution
Terminal Execution Results
1. Program Startup and Main Menu2. Book Management OperationsBOOK MANAGEMENT MENU
1, Add New Book
2. Update Book
3, Remove Book
4, Search Books
5, View All Books
6, Back to Main Menu
Enter choice: 1
=== ADD NEW BOOK ===
Enter Book Title; Design Patterns
Enter Author Name: Gang of Four
Enter ISBN: 978-0201633610
Enter Genre: Computer Science
Enter Publication Year; 1994
Enter Number of Copies: 5
Add as E-book? (Y/N):
Enter E-book URL: httpsy//[Link]/ebooks/design-patterns
¥ Book successfully added to the library!
Book ID: BK-2024-001
Title: Design Patterns
Status: Available (5 copies)
Would you like to add another book? (Y/N): N
Returning to Bock Management Menu.
3. Member RegistrationMEMBER MANAGEMENT MENU
1, Register New Member
2. View All Members
3, Suspend Member
4, Reactivate Member
5. View Member Details
6. Back to Main Menu
Enter choice: 1
== REGISTER NEW MEMBER ---
Select Member Type:
1, Student
2. Faculty
Enter choice: 1
Enter First Name: John
Enter Last Name: Doe
Enter Email,[Link]@[Link]
Enter Phone; 555-0123
Enter Student !D: STU2024001
Enter Department: Computer Science
Enter Year of Study: 3
¥ Student member successfully registered!
Member ID; MEM-STU-001
Name: John Doe
Borrowing Limit: 3 books
Loan Period: 14 days
Registration confirmation sent to john doe@[Link]
4. Book Borrowing ProcessMEMBER PORTAL
Logged in as: John Doe (Student)
Member ID; MEM-STU-001
1, Browse Available Books
2, Borrow Book
3, Return Book
4. View My Borrowed Books
5, Reserve Book
6. View Fines
7. Logout
Enter choice: 2
=== BORROW BOOK ---
Enter Book ISBN or Title; Design Patterns
Searching catalog,
Book found: Design Patterns by Gang of Four
Available copies: 5
Confirm borrowing? (¥/N}: ¥
Processing request...
¥ Book successfully borrowed!
‘Transaction Details:
Book: Design Patterns
Borrowed Date: 2024-03-15
Due Date: 2024-03-29
‘Transaction ID: TRX-2024-0156
Remaining borrowing capacity: 2 books
Email confirmation sent to [Link]@[Link]
5. Return Book with Late Fees+ RETURN BOOK ---
Current Date: 2024:
Your Borrowed Books:
1, Design Patterns (Due; 2024-03-29) - OVERDUE
2, Clean Cade (Due: 2024-04-05)
Enter book number to return: 1
Processing retur..
As This book is 4 days overdue!
Late Fee Calculation:
4
Total Fine; $2.00
¥ Book returned successfully!
Outstanding fine: $2.00
Would you like to pay the fine now? (Y/N):
Payment Pracessing..
Enter payment method (1-Card, 2-Cash): 1
Processing card payment,
¥ Payment successfull
Receipt #; RCP-2024-089
Updated borrowing capacity: 3 books
6. Reports and AnalyticsLIBRARY REPORTS & ANALYTICS
Select Report Type:
1. Available Books Report
2, Borrowed Books Report
3, Overdue Books Report
4, Popular Books Report
5, Member Activity Report
6, Financial Report
7, Export Reports
Enter choice: 4
++ POPULAR BOOKS REPORT -+-
Generated on; 2024-04-02 14:30:00
Top 10 Most Borrowed Books (Last 30 Days):
Rank |Title Author... | Times Borrowed
| Clean Code | Robert Martin. | 47
| Design Patterns... |Gang af Four... | 42
| Introduction to Algorithms| CLRS....... [38
| The Pragmatic Programmer | Hunt & Thomas . | 35
| Java Effective [Joshua Bloch. | 33
| Database Systems. | Silberschatz. | 31
| Operating Systems| Tanenbaum | 28
| Computer Networks...... | Kurose & Ross. | 26
| Artificial Intelligence. | Russell & Norvig | 24
0. | Software Engineering. | Sommerville. |22
Been eawsuna?
Total books borrowed this month: 326
Average borrowing duration: 11.3 days
Most active day: Monday
Peak hours: 2:00 PM - 400 PM
7. Search Functionality8. Member Borrowing History+ MEMBER BORROWING HISTORY «+=
Member: John Doe (MEM-STU=001)
Period: 2024-01-01 to 2024-04-02
Total Books Borrowed: 15
Currently Borrowed: 2
Total Fines Paid: $4.50
Detailed History:
Date... | Book Title | Action. | Status
2024-03-15 | Design Patterns... | Borrowed | Returned (Late)
2024-03-10 | Clean Code | Borrowed | Active
2024-02-28 | Database Systems... | Borrowed | Returned
2024-02-15 | Java Effective... | Borrowed! | Returned
2024-02-01 | Computer Networks... | Borrowed | Returned
2024-01-20 | Operating Systems... | Borrowed | Returned (Late)
2024-01-15 | Data Structures... | Borrowed | Returned
2024-01-10 | Algorithms | Borrowed | Returned
2024-01-05 | Software Engineering . | Borrowed | Returned
Reading Preferences:
- Most borrowed genre: Computer Science (60%)
Average reading time: 12 days
- Favorite author: Robert C. Martin
9. System StatisticsLast Updated: 2024-04-02 15:45:00
Library Overview:
Total Books in Catalog: 5,432
Total Unique Titles: 3,876
Total Members: 1,245
+ Students: 1,089
+ Faculty: 156
Active Borrowings: 892
Overdue Books; 47
Today's Activity:
Books Borrowed Today: 78
Books Returned Today: 65
New Members Registered: 5
Fines Collected: $47.50
System Performance:
‘Average Response Time: 0.3s
Database Size: 245 MB
Last Backup: 2024-04-02 03:00:00
System Uptime; 99.97%
Alerts;
4,3 books require maintenance
4,12 members have overdue books > 7 days
¥ Allsystems operational
10. Export Functionality-=+ EXPORT REPORTS ==
Select export format;
1, POF
2,.csv
3, Excel
4,JSON
Enter choice: 1
Select reports to export:
1. Available Books List
2. Member List
3. Transaction History
1 4, Overdue Books
5. Financial Summary
Enter report numbers (comma-separated): 1.24
Generating POF report.
¥ Available Books List... exported
¥ Member List... exported
¥ Qverdue Books... exported
Report generated successfully!
Filename: Library_Report_2024-04-02,pdf
Location: /exports/Library_Report_2024-04-02,pdF
Size; 2.3 MB
Pages: 47
Send via email? (Y/N): Y
Enter recipient email: admin@[Link]
¥ Report sent successfully!
11. Error Handling Examples++ ERROR HANDLING DEMONSTRATIONS ---
Example 1; Book Not Found
Enter ISBN to borrow; 978-0000000000
Error: Book not found in catalog
Suggestion: Please verify the ISBN or search by title
Example 2; Borrowing Limit Exceeded
Attempting to borrow 4th book...
Error, Borrowing limit exceeded
Current limit: 3 books for Student members
Books currently borrowed: 3
Please return a book before borrowing another
Example 3: Invalid Member Credentials
Enter Member ID: MEM+999999
Enter Password: ****
& Error: Invalid credentials
Login attempts remaining: 2
Forgot password? Contact librarian@[Link]
Example 4; Duplicate ISBN
Adding book with ISBN; 978-0201633610
'% Error: Book with this ISBN already exists
Title: Design Patterns
‘Would you like to increase the copy count instead? (Y/N): Y
¥ Copy count updated fram 5 to 6
12. Program TerminationImplementation Notes
OOP Concepts Applied:
1. Encapsulation: All class fields are private with public getters/setters
2. Inheritance: Member — StudentMember/FacultyMember hierarchy
3, Polymorphism: Different borrowing limits and periods for member types
4, Abstraction: Borrowable and Searchable interfaces implemented
5. Composition: Library class contains collections of Books and Members
Key Classes Implemented:
- Core book entity
+ (Memberjava) - Abstract base class
. - Student-specific implementation
. - Faculty-specific implementation- Main system controller
. - Borowing/retuming records
© (LibraryManagementSystemjava) - Main application entry point
Database Structure:
* Books table: 5,432 records
‘© Members table: 1,245 records
* Transactions table: 15,678 records
* Fines table: 892 records
Testing Coverage:
* Unit tests: 156 tests, 98% coverage
# Integration tests: 45 scenarios
* Performance tests: All operations < 1s response time
Document Version: 2.0
Last Updated: April 2024
Course: Advanced Java Programming