public class BookManage {
BookSet bookSet = new BookSet();
Scanner sc = new Scanner(System.in);
public void initial() {
Book Javajichujiaocheng = new Book();
Javajichujiaocheng.name = "Java基础教程";
Javajichujiaocheng.state =0;
Javajichujiaocheng.date = "2015 - 7 - 1";
Book shujukujishu = new Book();
shujukujishu.name = "数据库技术";
shujukujishu.state = 1;
shujukujishu.date = "0";
Book renyueshenhua = new Book();
renyueshenhua.name = "人月神话";
renyueshenhua.state = 1;
renyueshenhua.date = "0";
bookSet.books[0] = Javajichujiaocheng;
bookSet.books[1] = shujukujishu;
bookSet.books[2] = renyueshenhua;
}
public void startMenu() {
boolean flag = true;
do {
System.out.println("欢迎使用图书管理系统");
System.out.println("-----------------------");
System.out.println("1.新增图书");
System.out.println("2.查看图书");
System.out.println("3.删除图书");
System.out.println("4.借出图书");
System.out.println("5.归还图书");
System.out.println("6.退出");
System.out.println("-------------------------");
System.out.println("请选择要执行的操作:");
int choice = sc.nextInt();
switch (choice) {
case 1:
System.out.println("新增图书");
add();
break;
case 2:
System.out.println("查看图书");
search();
break;
case 3:
System.out.println("删除图书");
delete();
break;
case 4:
System.out.println("借出图书");
sell();
break;
case 5:
System.out.println("归还图书");
gui();
break;
case 6:
System.out.println("谢谢使用!");