public class 图书管理系统{
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Register().setVisible(true);
}// 图书管理类
public class BookManage {
BookSet bookSet = new BookSet();
/**
* 初始化
*/
public void initial() {
book java = new book();
java.setBook("java",1,2021/4/15",20);
book renyue = new book();
renyue.name = "程序语言基础";
renyue.setBook(."程序语言基础",1 ,null,0);
book jichu = new book();
jichu.setBook("计算机基础",1,null,0);
bookSet.books[0] = java ;
bookSet.books[1] = renyue ;
bookSet.books[2] = jichu ;
}
/*
菜单切换
*/
public void startMenu(){
boolean flag = true ;
do {
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("请选择");
Scanner scanner = new Scanner(System.in);
int choice = scanner.nextInt() ;
switch (choice){
case 1:
System.out.println("新增图书");
add();
break;
case 2:
System.out.println("查看图书");
chakan();
break;
case 3:
System.out.println("删除图书");
shan();
break;
case 4:
System.out.println("借出图书");
jie();
break;
case 5:
System.out.println("归还图书");
huan();
break;
case 6:
System.out.println("退出,谢谢使用");
default:
System.out.println("输入不符合要求请重新选择");
}
}while (flag) ;
}
/**
* 查看图书信息
*/
public void chakan(){
System.out.println("编号 \t\t\t 名称 \t\t\t 状态