import java.util.Scanner;
/**
* @author WangPenghui
* @date 2021/4/11 17:09
*/
public class tushuguanli {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
//初始化书本信息
String[] bookNames = new String[6];
int[] borrowDates = new int[6];
int[] borrowCounts = new int[6];
int[] states = new int[6];
//初始化三本书
bookNames[0] = "大学生安全教育";
borrowDates[0] = 15;
borrowCounts[0] = 16;
states[0] = 0;//0:可借阅 1:已借出
bookNames[1] = "老人与海";
borrowDates[1] = 0;
borrowCounts[1] = 0;
states[1] = 1;//0:可借阅 1:已借出
bookNames[2] = "Java程序开发";
borrowDates[2] = 0;
borrowCounts[2] = 0;
states[2] = 0;//0:可借阅 1:已借出
int num = -1;//初始化用户输入的数字
boolean flag = true;//true:不退出系统 false:退出系统
do {
System.out.println("************欢迎使用MiNi图书管理系统**********");
System.out.println("\t\t\t\t\t1.新增图书");
System.out.println("\t\t\t\t\t2.查看图书");
System.out.println("\t\t\t\t\t3.借阅图书");
System.out.println("\t\t\t\t\t4.归还图书");
System.out.println("\t\t\t\t\t5.删除图书");
System.out.println("\t\t\t\t\t6.退出系统");
System.out.print("\n请选择:");
int choose = sc.nextInt();
while (choose < 0 || choose > 6) {
System.out.print("输入有误,重新输入:");
choose = sc.nextInt();
}
switch (choose) {
case 1:
System.out.println("************1.新增图书**********");
System.out.print("请输入新增图书的名字:");
String addBook = sc.next();
boolean isAdd = false;//false:不能添加图书 true:可以添加图书
//遍历数组,查找新增图书的位置
for (int i = 1; i < bookNames.length; i++) {
//数组没满,可以新增图书
if (bookNames[i] == null) {
isAdd = true;
bookNames[i] = addBook;
}
}
}
}while(flag);
}
}