-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibraryApp.java
More file actions
35 lines (27 loc) · 1.37 KB
/
Copy pathLibraryApp.java
File metadata and controls
35 lines (27 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import java.time.LocalDate;
public class LibraryApp {
public static void main(String[] args) {
System.out.println("==========================================");
System.out.println(" ENTERPRISE LIBRARY MANAGEMENT SYSTEM ");
System.out.println("==========================================");
Library lib = new Library();
// Add Books
lib.addBook(new Book("978-0134685991", "Effective Java", "Joshua Bloch"));
lib.addBook(new Book("978-0596009205", "Head First Design Patterns", "Eric Freeman"));
lib.addBook(new Book("978-0132350884", "Clean Code", "Robert C. Martin"));
// Register Members
lib.registerMember(new Member("MEM-101", "Alex Mercer"));
lib.registerMember(new Member("MEM-102", "Elena Rostova"));
// Display Initial Catalog
lib.displayCatalog();
// Perform Checkout
System.out.println("\n--- Executing Transactions ---");
lib.checkOutBook("MEM-101", "978-0134685991");
// Simulate Overdue Return (Returned 20 days later instead of 14)
System.out.println("\n--- Processing Return ---");
LocalDate simulatedReturnDate = LocalDate.now().plusDays(20);
lib.returnBook("MEM-101", "978-0134685991", simulatedReturnDate);
// Display Updated Catalog
lib.displayCatalog();
}
}