1.核心需求
1
、简单的登录
2
、管理端
整理书籍
(
该功能为可扩展功能
)
查阅书籍
增加书籍
删除书籍
打印书籍列表
退出
3
、用户端
查询书籍
借阅书籍
归还书籍
退出
所以先创建三个包
1.book 2.operation 3.user
book包中创建Book和BookList两个类
Book类代码
package book;
public class Book {
private String name;
private String author;
private String type;
private int price;
private boolean isBorrowed;
public Book(String name,String author,String type,int price,boolean isBorrowed) {
this.name=name;
this.author=author;
this.type=type;
this.price=price;
this.isBorrowed=false;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public boolean isBorrowed(boolean b) {
return isBorrowed;
}
public void setBorrowed(boolean borrowed) {
isBorrowed = borrowed;
}
@Override
public String toString() {
return "Book{" +
"name='" + name + '\'' +
", author='" + author + '\'' +
", type='" + type + '\'' +
", price=" + price +