-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathManageLibrary.java
More file actions
34 lines (33 loc) · 1.14 KB
/
ManageLibrary.java
File metadata and controls
34 lines (33 loc) · 1.14 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
public class ManageLibrary {
private Library library;
public ManageLibrary() {
this.library = new Library();
}
public void addBook(String title, String author, String publication){
Book newBook = new Book(title,author,publication);
library.addBook(newBook);
System.out.println("\nBook added Successfully");
}
public void SearchBook(String title){
Book book = library.findBook(title);
if(book != null){
System.out.println("Book is available");
if(book.isAvailable()){
System.out.println("You can issue this book");
}else{
System.out.println("Book is not available");
}
}else{
System.out.println("Book not found");
}
}
public void displayBooks(){
library.displayBooks();
}
public void removeBook(String title){
library.removeBook(title);
}
public void editBook(String title, String newTitle, String newAuthor, String newPublication){
library.editBooks(title, newTitle, newAuthor, newPublication);
}
}