-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
31 lines (21 loc) · 1008 Bytes
/
Main.java
File metadata and controls
31 lines (21 loc) · 1008 Bytes
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
public class Main {
public static void main(String[]args) {
//Create Library instance
Library lib = new Library();
//Create and add books to the library
Book book1 = new Book("Nguiramto", "MBAINAISSEM DOUGT", "524236572754", 500);
Book book2 = new Book("Just like One-One", "JASSE JOACHIM", "9383376354245", 345);
// add books to the library
lib.addBook(book1);
lib.addBook(book2);
//Register members
Member member1 = new Member("Douglas Kessely", "M0543");
Member member2 = new Member("Gibson Mbainaissem", "M0484");
//Lend a book to a member
lib.lendBook("98765432345", "M0987");
lib.lendBook("56787987657", "M04557");
//Display the status of the book and member
System.out.println("Copies of 'Nguiramto' after lending: " +book1.getCopiesAvailable());
System.out.println("Member 'Douglas Kessely' boorowed books: " + member1.borrowedBooks.size());
}
}