import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Books b=new Books();
int c;
System.out.println("Choose an operation:\n1. Add book\n2. Search book\n3. List books");
Scanner in=new Scanner(System.in);
c=in.nextInt();
if(c==1){
b.addBook(123, "Hello world");
}
else if(c==2){
b.Searchbooks(123);
}
else if(c==3){
b.Listbooks();
}
}
}
class Books{
private int book_id;
private String book_name;
public void setBookId(int id){
book_id=id;
}
public int getBookId(){
return book_id;
}
public void setBookName(String n){
book_name=n;
}
public String getBookName(){
return book_name;
}
public void addBook(int id,String name){
System.out.println("A new book added:\nName: "+name+"\nBook id: "+id);
}
public void Searchbooks(int id){
System.out.println("Books number "+id+" is available");
}
public void Listbooks(){
System.out.println("Name: "+getBookName()+"\nBook id: "+getBookId());
}
}
class Admin{
private String name;
public void setName(String n){
name=n;
}
public String getName(){
return name;
}
}
class User{
private String name;
private int user_id;
public void setName(String n){
name=n;
}
public String getName(){
return name;
}
public void setUserId(int id){
user_id=id;
}
public int getUserId(){
return user_id;
}
}
Comments
Leave a comment