From 502755411810ba56c2f4b6adee9bd350e94d9745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=96=E7=BA=B7?= <8332024+o2444091281@user.noreply.gitee.com> Date: Wed, 5 May 2021 16:34:52 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=BB=84=E9=94=9F=E5=AE=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\344\271\246\347\256\241\347\220\206.java" | 561 ++++++++++++++++++ 1 file changed, 561 insertions(+) create mode 100644 "Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/\351\273\204\351\224\237\345\256\207/\345\233\276\344\271\246\347\256\241\347\220\206.java" diff --git "a/Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/\351\273\204\351\224\237\345\256\207/\345\233\276\344\271\246\347\256\241\347\220\206.java" "b/Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/\351\273\204\351\224\237\345\256\207/\345\233\276\344\271\246\347\256\241\347\220\206.java" new file mode 100644 index 0000000..f1354cf --- /dev/null +++ "b/Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/\351\273\204\351\224\237\345\256\207/\345\233\276\344\271\246\347\256\241\347\220\206.java" @@ -0,0 +1,561 @@ +import java.awt.print.Book; +import java.lang.invoke.SwitchPoint; +import java.lang.reflect.Array; +import java.util.IllegalFormatCodePointException; +import java.util.Scanner; + +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT; + +public class Apr26 { +static String userinfo[][]=new String[100][4]; +static String BookInfo[][]=new String[100][5]; +static String PressInfo[][]=new String[100][3]; +static Scanner arr =new Scanner(System.in); + +public static void main(String[] args) { +// TODO 自动生成的方法存根 +initialize();//初始化 +head();//登录--注册 +} + +private static void initialize() {//初始化 +userinfo [0] [0]="软件部"; +userinfo [0] [1]="软件开发员"; +userinfo [0] [2]="name1"; +userinfo [0] [3]="123"; + +userinfo [1] [0]="测试部"; +userinfo [1] [1]="测试员"; +userinfo [1] [2]="name2"; +userinfo [1] [3]="123"; + +userinfo [2] [0]="测试部"; +userinfo [2] [1]="测试员"; +userinfo [2] [2]="admin"; +userinfo [2] [3]="123"; + +BookInfo[0][0]="A1111"; +BookInfo[0][1]="白夜行"; +BookInfo[0][2]="1"; +BookInfo[0][3]="cs1"; +BookInfo[0][4]="1"; + +BookInfo[1][0]="B2222"; +BookInfo[1][1]="三国演义"; +BookInfo[1][2]="2"; +BookInfo[1][3]="cs2"; +BookInfo[1][4]="2"; + +BookInfo[1][0]="C3333"; +BookInfo[1][1]="水浒传"; +BookInfo[1][2]="3"; +BookInfo[1][3]="cs3"; +BookInfo[1][4]="3"; + +PressInfo[0][0]="中华书局"; +PressInfo[0][1]="北京市王府井大街36号"; +PressInfo[0][2]="张三"; + +PressInfo[1][0]="作家出版社"; +PressInfo[1][1]="香港九龙荷李活商业中心8楼"; +PressInfo[1][2]="李四"; +} +private static void head() {// 登录--注册 +System.out.println("欢迎来到闽大图书管理系统!"); +System.out.println("1.登录 2.注册"); +int a= arr.nextInt(); +switch(a) { +case 1: +enter(); +break; +case 2: +register(); +break; +} + +} + +private static void enter() {//登录 +System.out.println("请输入用户名:"); +String usesrName=arr.next(); +System.out.println("请输入密码:"); +String parkword=arr.next(); +boolean judge=false; + +for (int i = 0; i < userinfo.length; i++) { +if (usesrName.equals(userinfo[i][2]) && parkword.equals(userinfo[i][3])) { +judge=true; +break; +} +} +if (judge) { +System.out.println("登录成功!"); +System.out.println(usesrName+","+"欢迎来到闽大图书管理系统!"); +LibraryMM(); +}else { +System.out.println("用户名或密码错误!请重新登录!"); +head(); +} + +} + + +private static void LibraryMM() {//图书管理系统 +System.out.println("请输入数字进行选择:1 图书管理 2 出版社管理 3 退出登录 4 退出系统"); +int a= arr.nextInt(); +switch(a) { +case 1: +BookManage();//图书管理 +break; +case 2: +publishingHouse();//出版社管理 +case 3: +head();//出版设管理 +break; +case 4: +System.exit(0);//退出系统 +break; +} + +} + +private static void publishingHouse() {//出版设管理 +System.out.println("请输入:1.增加 2.删除 3.更新 4.根据出版社名称查询 5.查询所有出版社 6.返回上一级菜单"); +int a= arr.nextInt(); +switch(a) { +case 1://增加 +increase2(); +break; +case 2://删除 +remove2(); +break; +case 3://更新 +update2(); +break; +case 4://查询 +NameQuery(); +case 5: +System.out.println("出版社名称 地址 联系人"); +for (int i = 0; i < PressInfo.length; i++) { +if(PressInfo[i][0]==null) { +break; +} + +for (int j = 0; j < PressInfo[i].length; j++) { +System.out.print(PressInfo[i][j]+" "); +} +System.out.println(); +} +case 6: +LibraryMM(); +break; +} +} + +private static void BookManage() {//图书管理 +System.out.println("请输入:1.增加 2.删除 3.更新 4.查询 5.返回上一级菜单"); +int a= arr.nextInt(); +switch(a) { +case 1://增加 +increase(); +break; +case 2://删除 +remove(); +case 3://更新 +update(); +break; +case 4://查询 +inquire(); +case 5: +LibraryMM(); +break; +} + +} +private static void NameQuery() { +System.out.println("请输入出版社名称:"); +String name=arr.next(); +for (int i = 0; i < PressInfo.length; i++) { +if (name.equals(PressInfo[i][0])) { +System.out.println("出版社名称:"+name); +System.out.println("出版社地址:"+PressInfo[i][1]); +System.out.println("出版社联系人:"+PressInfo[i][2]); +LibraryMM(); +break; +}else { +System.out.println("请输入正确的出版社名称"); +publishingHouse(); +} +} +} +private static void update2() {//出版社更新 +System.out.println("请输入要更新的出版社名称:"); +String updateName=arr.next(); + for (int i = 0; i < PressInfo.length; i++) { +if (updateName.equals(PressInfo[i][0])) { +System.out.println("请输入要更新的地址:"); +String newddress =arr.next(); +System.out.println("请输入要更新的联系人姓名:"); +String newName=arr.next(); +System.out.println("更新成功"); +System.out.println("出版社名称 地址 联系人"); +System.out.println(updateName+" "+newddress+" "+newName); +int index=-1; +for (int j = 0; j < PressInfo.length; j++) { +if(userinfo[j][0]==null) { +index=j; +break; +} +} +PressInfo[index][1]=newddress; +PressInfo[index][2]=newName; +LibraryMM(); +}else { +System.out.println("没查找到这个出版社,请重新输入"); +LibraryMM(); +} +} + + +} + +private static void remove2() {//出版社删除 +System.out.println("请输入要删除的出版社名称:"); +String delName=arr.next(); +isExist(PressInfo, 0, delName); +int index=-1; +for (int i = 0; i < PressInfo.length; i++) { +if (delName.equals(PressInfo[i][0])) { +index=i; +break; +} +} + +PressInfo[index][0]=null; +PressInfo[index][1]=null; +PressInfo[index][2]=null; +System.out.println("删除成功!"); +LibraryMM(); + +} + +private static void increase2() {//出版社增加 + int index=-1; + for (int i = 0; i < PressInfo.length; i++) { + if(PressInfo[i][0]==null) { + index=i; + break; + } + + } +System.out.println("请输入出版社名称:"); +PressInfo[index][0]=arr.next(); +System.out.println("请输入出版社地址:"); +PressInfo[index][1]=arr.next(); +System.out.println("请输入出版社联系人:"); +PressInfo[index][2]=arr.next(); +System.out.println("出版社添加成功"); +LibraryMM(); + +} +private static void inquire() {//查询 +System.out.println("请输入查询种类:1.isbn 2.书名(模糊) 3.出版社 4. 作者 5. 价格范围 6.查询所有 7.返回上一级 "); +int a=arr.nextInt(); +switch (a) { +case 1: +System.out.println("请输入ISBN号:"); +String isbn=arr.next(); +for (int i = 0; i < BookInfo.length; i++) { +if (isbn.equals(BookInfo[i][0])) { +System.out.println("ISBN 书名 价格 出版社 作者"); +System.out.print(BookInfo[i][0]); +System.out.print(" "); +System.out.print(BookInfo[i][1]); +System.out.print(" "); +System.out.print(BookInfo[i][2]); +System.out.print(" "); +System.out.print(BookInfo[i][3]); +System.out.print(" "); +System.out.print(BookInfo[i][4]); +System.out.println(); +inquire(); +break; +}else { +System.out.println("请输入正确的ISBN"); +inquire(); +} +} +break; +case 2: +System.out.println("请输入书名:"); +String book=arr.next(); +for (int i = 0; i < BookInfo.length; i++) { +if (BookInfo!=null && BookInfo[i][1].indexOf(book)!=-1) { +System.out.println("ISBN 书名 价格 出版社 作者"); +System.out.print(BookInfo[i][0]); +System.out.print(" "); +System.out.print(BookInfo[i][1]); +System.out.print(" "); +System.out.print(BookInfo[i][2]); +System.out.print(" "); +System.out.print(BookInfo[i][3]); +System.out.print(" "); +System.out.print(BookInfo[i][4]); +System.out.println(); +inquire(); +break; +}else { +System.out.println("请输入正确的书名"); +inquire(); +} +} +break; +case 3: + PressInquiry(); +//System.out.println("请输入出版社:"); +//String press=arr.next(); +//for (int i = 0; i < PressInfo.length; i++) { +//if (press.equals(BookInfo[i][2])) { +//System.out.println("ISBN 书名 价格 出版社 作者"); +//System.out.print(BookInfo[i][0]); +//System.out.print(" "); +//System.out.print(BookInfo[i][1]); +//System.out.print(" "); +//System.out.print(BookInfo[i][2]); +//System.out.print(" "); +//System.out.print(BookInfo[i][3]); +//System.out.print(" "); +//System.out.print(BookInfo[i][4]); +//System.out.println(); +//inquire(); +//break; +//}else { +//System.out.println("请输入正确的出版社"); +//inquire(); +//} +//} +break; +case 4: +System.out.println("请输入作者:"); +String worker=arr.next(); +for (int i = 0; i < BookInfo.length; i++) { +if (worker.equals(BookInfo[i][3])) { +System.out.println("ISBN 书名 价格 出版社 作者"); +System.out.print(BookInfo[i][0]); +System.out.print(" "); +System.out.print(BookInfo[i][1]); +System.out.print(" "); +System.out.print(BookInfo[i][2]); +System.out.print(" "); +System.out.print(BookInfo[i][3]); +System.out.print(" "); +System.out.print(BookInfo[i][4]); +System.out.println(); +inquire(); +break; +}else { +System.out.println("请输入正确的作者"); +inquire(); +} +} + +break; +case 5: +System.out.println("请输入查询的价格区间:"); +double money1=arr.nextDouble(); +double money2=arr.nextDouble(); +for (int i = 0; i < BookInfo.length; i++) { +double price = Double.parseDouble(BookInfo[i][4]); +if (money1<=price && money2>=price) { +System.out.println("ISBN 书名 价格 出版社 作者"); +System.out.print(BookInfo[i][0]); +System.out.print(" "); +System.out.print(BookInfo[i][1]); +System.out.print(" "); +System.out.print(BookInfo[i][2]); +System.out.print( " "); +System.out.print(BookInfo[i][3]); +System.out.print(" "); +System.out.print(BookInfo[i][4]); +System.out.println(); +inquire(); +break; +} +} + +break; +case 6: +System.out.println("ISBN 书名 价格 出版社 作者"); +for (int i = 0; i < BookInfo.length; i++) { +if(BookInfo[i][0]==null) { +break; +} + +for (int j = 0; j < BookInfo[i].length; j++) { +System.out.print(BookInfo[i][j]+" "); +} +System.out.println(); +} + +break; +case 7: +BookManage() ; +break; + +default: +break; +} +} + +private static void PressInquiry() { + // 出版社查询 + + String[][] pubs = new String[PressInfo.length][3]; + + + for (int i = 0; i < pubs.length; i++) { + if (PressInfo[i][0]!=null) { + pubs[i] = PressInfo[i]; + } + } + for (int i = 0; i < pubs.length; i++) { + if (pubs[i][0]!=null) { + System.out.print((i+1)+"."+pubs[i][0]+" "); + } + } + System.out.println(); + System.out.println("请选择出版社"); + int key = arr.nextInt(); + System.out.println("ISBN\t书名\t价格\t出版社\t作者"); + for (int i = 0; i < BookInfo.length; i++) { + if (pubs[key-1][0].equals(BookInfo[i][3])) { + System.out.println(BookInfo[i][0]+"\t"+BookInfo[i][1]+"\t"+BookInfo [i][2] + +"\t"+BookInfo[i][3]+"\t"+BookInfo[i][4]); + } + } +} + +private static void update() {//更新 +System.out.println("请输入ISBN号:"); +String updateISBN=arr.next(); + for (int i = 0; i < BookInfo.length; i++) { +if (updateISBN.equals(BookInfo[i][0])) { +System.out.println("请输入新的书名:"); +String newName =arr.next(); +System.out.println("请输入新的价格:"); +String newMoney=arr.next(); +System.out.println("请输入新的出版社:"); +String newpublishing=arr.next(); +System.out.println("请输入新的作者:"); +String newWorker=arr.next(); +int index=-1; +for (int j = 0; j < BookInfo.length; j++) { +if(userinfo[j][0]==null) { +index=j; +break; +} +} +userinfo[index][1]=newName; +userinfo[index][2]=newMoney; +userinfo[index][3]=newpublishing; +userinfo[index][4]=newWorker; +}else { +System.out.println("没查找到这个ISBN,请重新输入"); + BookManage() ; +} +} + +} + +private static void remove() {//删除 +System.out.println("请输入要删除的书本名称:"); +String delBook=arr.next(); +int index=-1; +for (int i = 0; i < BookInfo.length; i++) { +if (delBook.equals(BookInfo[i][1])) { +index=i; +break; +} +} +BookInfo[index][0]=null; +BookInfo[index][1]=null; +BookInfo[index][2]=null; +BookInfo[index][3]=null; +BookInfo[index][4]=null; +System.out.println("删除成功!"); +BookManage(); +} + +private static void increase() {//增加 +int index=-1; +for (int i = 0; i < BookInfo.length; i++) { +if(BookInfo[i][0]==null) { +index=i; +break; +} + +} +System.out.println("请输入图书ISBN:"); +String ISBN=arr.next(); +for (int i = 0; i < BookInfo.length; i++) { +if (ISBN.equals(BookInfo[i][0])) { +System.out.println("图书已存在"); +BookManage(); +}else { +BookInfo[index][0]=ISBN; +System.out.println("请输入书名:"); +BookInfo[index][1]=arr.next(); +System.out.println("请输入价格:"); +BookInfo[index][2]=arr.next(); +System.out.println("请输入出版社:"); +BookInfo[index][3]=arr.next(); +System.out.println("请输入作者:"); +BookInfo[index][4]=arr.next(); +System.out.println("添加成功!"); +} + +} + + +BookManage(); + +} + +private static void register() {//注册 +System.out.println("请输入所属部门:"); +String apartment =arr.next(); +System.out.println("请输入用户角色:"); +String name =arr.next(); +System.out.println("请输入用户名:"); +String user =arr.next(); +System.out.println("请输入密码:"); +String password =arr.next(); +System.out.println("注册成功!"); +System.out.println(user+","+"欢迎来到闽大图书管理系统!"); + +int index=-1; +for (int i = 0; i < userinfo.length; i++) { +if(userinfo[i][0]==null) { +index=i; +break; +} +} +userinfo[index][0]=apartment; +userinfo[index][1]=name; +userinfo[index][2]=user; +userinfo[index][3]=password; +head(); +} +private static boolean isExist(String[][] arr,int index,String isbn) { +boolean flag=false; +for (int i = 0; i < arr.length; i++) { +if (isbn.equals(BookInfo[i][2])) { +flag=true; +break; +} +} +return flag; +} + + +} \ No newline at end of file -- Gitee From 45a13a599d1e47f5a19362e079679ae812a95bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=96=E7=BA=B7?= <8332024+o2444091281@user.noreply.gitee.com> Date: Thu, 6 May 2021 10:40:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20Java?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=5F=E7=BC=96=E8=AF=91=E7=89=88/=E7=AC=AC4?= =?UTF-8?q?=E5=B0=8F=E7=BB=84/=E9=BB=84=E9=94=9F=E5=AE=87/=E9=BB=84?= =?UTF-8?q?=E9=94=9F=E5=AE=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\344\271\246\347\256\241\347\220\206.java" | 561 ------------------ 1 file changed, 561 deletions(-) delete mode 100644 "Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/\351\273\204\351\224\237\345\256\207/\345\233\276\344\271\246\347\256\241\347\220\206.java" diff --git "a/Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/\351\273\204\351\224\237\345\256\207/\345\233\276\344\271\246\347\256\241\347\220\206.java" "b/Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/\351\273\204\351\224\237\345\256\207/\345\233\276\344\271\246\347\256\241\347\220\206.java" deleted file mode 100644 index f1354cf..0000000 --- "a/Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/\351\273\204\351\224\237\345\256\207/\345\233\276\344\271\246\347\256\241\347\220\206.java" +++ /dev/null @@ -1,561 +0,0 @@ -import java.awt.print.Book; -import java.lang.invoke.SwitchPoint; -import java.lang.reflect.Array; -import java.util.IllegalFormatCodePointException; -import java.util.Scanner; - -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT; - -public class Apr26 { -static String userinfo[][]=new String[100][4]; -static String BookInfo[][]=new String[100][5]; -static String PressInfo[][]=new String[100][3]; -static Scanner arr =new Scanner(System.in); - -public static void main(String[] args) { -// TODO 自动生成的方法存根 -initialize();//初始化 -head();//登录--注册 -} - -private static void initialize() {//初始化 -userinfo [0] [0]="软件部"; -userinfo [0] [1]="软件开发员"; -userinfo [0] [2]="name1"; -userinfo [0] [3]="123"; - -userinfo [1] [0]="测试部"; -userinfo [1] [1]="测试员"; -userinfo [1] [2]="name2"; -userinfo [1] [3]="123"; - -userinfo [2] [0]="测试部"; -userinfo [2] [1]="测试员"; -userinfo [2] [2]="admin"; -userinfo [2] [3]="123"; - -BookInfo[0][0]="A1111"; -BookInfo[0][1]="白夜行"; -BookInfo[0][2]="1"; -BookInfo[0][3]="cs1"; -BookInfo[0][4]="1"; - -BookInfo[1][0]="B2222"; -BookInfo[1][1]="三国演义"; -BookInfo[1][2]="2"; -BookInfo[1][3]="cs2"; -BookInfo[1][4]="2"; - -BookInfo[1][0]="C3333"; -BookInfo[1][1]="水浒传"; -BookInfo[1][2]="3"; -BookInfo[1][3]="cs3"; -BookInfo[1][4]="3"; - -PressInfo[0][0]="中华书局"; -PressInfo[0][1]="北京市王府井大街36号"; -PressInfo[0][2]="张三"; - -PressInfo[1][0]="作家出版社"; -PressInfo[1][1]="香港九龙荷李活商业中心8楼"; -PressInfo[1][2]="李四"; -} -private static void head() {// 登录--注册 -System.out.println("欢迎来到闽大图书管理系统!"); -System.out.println("1.登录 2.注册"); -int a= arr.nextInt(); -switch(a) { -case 1: -enter(); -break; -case 2: -register(); -break; -} - -} - -private static void enter() {//登录 -System.out.println("请输入用户名:"); -String usesrName=arr.next(); -System.out.println("请输入密码:"); -String parkword=arr.next(); -boolean judge=false; - -for (int i = 0; i < userinfo.length; i++) { -if (usesrName.equals(userinfo[i][2]) && parkword.equals(userinfo[i][3])) { -judge=true; -break; -} -} -if (judge) { -System.out.println("登录成功!"); -System.out.println(usesrName+","+"欢迎来到闽大图书管理系统!"); -LibraryMM(); -}else { -System.out.println("用户名或密码错误!请重新登录!"); -head(); -} - -} - - -private static void LibraryMM() {//图书管理系统 -System.out.println("请输入数字进行选择:1 图书管理 2 出版社管理 3 退出登录 4 退出系统"); -int a= arr.nextInt(); -switch(a) { -case 1: -BookManage();//图书管理 -break; -case 2: -publishingHouse();//出版社管理 -case 3: -head();//出版设管理 -break; -case 4: -System.exit(0);//退出系统 -break; -} - -} - -private static void publishingHouse() {//出版设管理 -System.out.println("请输入:1.增加 2.删除 3.更新 4.根据出版社名称查询 5.查询所有出版社 6.返回上一级菜单"); -int a= arr.nextInt(); -switch(a) { -case 1://增加 -increase2(); -break; -case 2://删除 -remove2(); -break; -case 3://更新 -update2(); -break; -case 4://查询 -NameQuery(); -case 5: -System.out.println("出版社名称 地址 联系人"); -for (int i = 0; i < PressInfo.length; i++) { -if(PressInfo[i][0]==null) { -break; -} - -for (int j = 0; j < PressInfo[i].length; j++) { -System.out.print(PressInfo[i][j]+" "); -} -System.out.println(); -} -case 6: -LibraryMM(); -break; -} -} - -private static void BookManage() {//图书管理 -System.out.println("请输入:1.增加 2.删除 3.更新 4.查询 5.返回上一级菜单"); -int a= arr.nextInt(); -switch(a) { -case 1://增加 -increase(); -break; -case 2://删除 -remove(); -case 3://更新 -update(); -break; -case 4://查询 -inquire(); -case 5: -LibraryMM(); -break; -} - -} -private static void NameQuery() { -System.out.println("请输入出版社名称:"); -String name=arr.next(); -for (int i = 0; i < PressInfo.length; i++) { -if (name.equals(PressInfo[i][0])) { -System.out.println("出版社名称:"+name); -System.out.println("出版社地址:"+PressInfo[i][1]); -System.out.println("出版社联系人:"+PressInfo[i][2]); -LibraryMM(); -break; -}else { -System.out.println("请输入正确的出版社名称"); -publishingHouse(); -} -} -} -private static void update2() {//出版社更新 -System.out.println("请输入要更新的出版社名称:"); -String updateName=arr.next(); - for (int i = 0; i < PressInfo.length; i++) { -if (updateName.equals(PressInfo[i][0])) { -System.out.println("请输入要更新的地址:"); -String newddress =arr.next(); -System.out.println("请输入要更新的联系人姓名:"); -String newName=arr.next(); -System.out.println("更新成功"); -System.out.println("出版社名称 地址 联系人"); -System.out.println(updateName+" "+newddress+" "+newName); -int index=-1; -for (int j = 0; j < PressInfo.length; j++) { -if(userinfo[j][0]==null) { -index=j; -break; -} -} -PressInfo[index][1]=newddress; -PressInfo[index][2]=newName; -LibraryMM(); -}else { -System.out.println("没查找到这个出版社,请重新输入"); -LibraryMM(); -} -} - - -} - -private static void remove2() {//出版社删除 -System.out.println("请输入要删除的出版社名称:"); -String delName=arr.next(); -isExist(PressInfo, 0, delName); -int index=-1; -for (int i = 0; i < PressInfo.length; i++) { -if (delName.equals(PressInfo[i][0])) { -index=i; -break; -} -} - -PressInfo[index][0]=null; -PressInfo[index][1]=null; -PressInfo[index][2]=null; -System.out.println("删除成功!"); -LibraryMM(); - -} - -private static void increase2() {//出版社增加 - int index=-1; - for (int i = 0; i < PressInfo.length; i++) { - if(PressInfo[i][0]==null) { - index=i; - break; - } - - } -System.out.println("请输入出版社名称:"); -PressInfo[index][0]=arr.next(); -System.out.println("请输入出版社地址:"); -PressInfo[index][1]=arr.next(); -System.out.println("请输入出版社联系人:"); -PressInfo[index][2]=arr.next(); -System.out.println("出版社添加成功"); -LibraryMM(); - -} -private static void inquire() {//查询 -System.out.println("请输入查询种类:1.isbn 2.书名(模糊) 3.出版社 4. 作者 5. 价格范围 6.查询所有 7.返回上一级 "); -int a=arr.nextInt(); -switch (a) { -case 1: -System.out.println("请输入ISBN号:"); -String isbn=arr.next(); -for (int i = 0; i < BookInfo.length; i++) { -if (isbn.equals(BookInfo[i][0])) { -System.out.println("ISBN 书名 价格 出版社 作者"); -System.out.print(BookInfo[i][0]); -System.out.print(" "); -System.out.print(BookInfo[i][1]); -System.out.print(" "); -System.out.print(BookInfo[i][2]); -System.out.print(" "); -System.out.print(BookInfo[i][3]); -System.out.print(" "); -System.out.print(BookInfo[i][4]); -System.out.println(); -inquire(); -break; -}else { -System.out.println("请输入正确的ISBN"); -inquire(); -} -} -break; -case 2: -System.out.println("请输入书名:"); -String book=arr.next(); -for (int i = 0; i < BookInfo.length; i++) { -if (BookInfo!=null && BookInfo[i][1].indexOf(book)!=-1) { -System.out.println("ISBN 书名 价格 出版社 作者"); -System.out.print(BookInfo[i][0]); -System.out.print(" "); -System.out.print(BookInfo[i][1]); -System.out.print(" "); -System.out.print(BookInfo[i][2]); -System.out.print(" "); -System.out.print(BookInfo[i][3]); -System.out.print(" "); -System.out.print(BookInfo[i][4]); -System.out.println(); -inquire(); -break; -}else { -System.out.println("请输入正确的书名"); -inquire(); -} -} -break; -case 3: - PressInquiry(); -//System.out.println("请输入出版社:"); -//String press=arr.next(); -//for (int i = 0; i < PressInfo.length; i++) { -//if (press.equals(BookInfo[i][2])) { -//System.out.println("ISBN 书名 价格 出版社 作者"); -//System.out.print(BookInfo[i][0]); -//System.out.print(" "); -//System.out.print(BookInfo[i][1]); -//System.out.print(" "); -//System.out.print(BookInfo[i][2]); -//System.out.print(" "); -//System.out.print(BookInfo[i][3]); -//System.out.print(" "); -//System.out.print(BookInfo[i][4]); -//System.out.println(); -//inquire(); -//break; -//}else { -//System.out.println("请输入正确的出版社"); -//inquire(); -//} -//} -break; -case 4: -System.out.println("请输入作者:"); -String worker=arr.next(); -for (int i = 0; i < BookInfo.length; i++) { -if (worker.equals(BookInfo[i][3])) { -System.out.println("ISBN 书名 价格 出版社 作者"); -System.out.print(BookInfo[i][0]); -System.out.print(" "); -System.out.print(BookInfo[i][1]); -System.out.print(" "); -System.out.print(BookInfo[i][2]); -System.out.print(" "); -System.out.print(BookInfo[i][3]); -System.out.print(" "); -System.out.print(BookInfo[i][4]); -System.out.println(); -inquire(); -break; -}else { -System.out.println("请输入正确的作者"); -inquire(); -} -} - -break; -case 5: -System.out.println("请输入查询的价格区间:"); -double money1=arr.nextDouble(); -double money2=arr.nextDouble(); -for (int i = 0; i < BookInfo.length; i++) { -double price = Double.parseDouble(BookInfo[i][4]); -if (money1<=price && money2>=price) { -System.out.println("ISBN 书名 价格 出版社 作者"); -System.out.print(BookInfo[i][0]); -System.out.print(" "); -System.out.print(BookInfo[i][1]); -System.out.print(" "); -System.out.print(BookInfo[i][2]); -System.out.print( " "); -System.out.print(BookInfo[i][3]); -System.out.print(" "); -System.out.print(BookInfo[i][4]); -System.out.println(); -inquire(); -break; -} -} - -break; -case 6: -System.out.println("ISBN 书名 价格 出版社 作者"); -for (int i = 0; i < BookInfo.length; i++) { -if(BookInfo[i][0]==null) { -break; -} - -for (int j = 0; j < BookInfo[i].length; j++) { -System.out.print(BookInfo[i][j]+" "); -} -System.out.println(); -} - -break; -case 7: -BookManage() ; -break; - -default: -break; -} -} - -private static void PressInquiry() { - // 出版社查询 - - String[][] pubs = new String[PressInfo.length][3]; - - - for (int i = 0; i < pubs.length; i++) { - if (PressInfo[i][0]!=null) { - pubs[i] = PressInfo[i]; - } - } - for (int i = 0; i < pubs.length; i++) { - if (pubs[i][0]!=null) { - System.out.print((i+1)+"."+pubs[i][0]+" "); - } - } - System.out.println(); - System.out.println("请选择出版社"); - int key = arr.nextInt(); - System.out.println("ISBN\t书名\t价格\t出版社\t作者"); - for (int i = 0; i < BookInfo.length; i++) { - if (pubs[key-1][0].equals(BookInfo[i][3])) { - System.out.println(BookInfo[i][0]+"\t"+BookInfo[i][1]+"\t"+BookInfo [i][2] - +"\t"+BookInfo[i][3]+"\t"+BookInfo[i][4]); - } - } -} - -private static void update() {//更新 -System.out.println("请输入ISBN号:"); -String updateISBN=arr.next(); - for (int i = 0; i < BookInfo.length; i++) { -if (updateISBN.equals(BookInfo[i][0])) { -System.out.println("请输入新的书名:"); -String newName =arr.next(); -System.out.println("请输入新的价格:"); -String newMoney=arr.next(); -System.out.println("请输入新的出版社:"); -String newpublishing=arr.next(); -System.out.println("请输入新的作者:"); -String newWorker=arr.next(); -int index=-1; -for (int j = 0; j < BookInfo.length; j++) { -if(userinfo[j][0]==null) { -index=j; -break; -} -} -userinfo[index][1]=newName; -userinfo[index][2]=newMoney; -userinfo[index][3]=newpublishing; -userinfo[index][4]=newWorker; -}else { -System.out.println("没查找到这个ISBN,请重新输入"); - BookManage() ; -} -} - -} - -private static void remove() {//删除 -System.out.println("请输入要删除的书本名称:"); -String delBook=arr.next(); -int index=-1; -for (int i = 0; i < BookInfo.length; i++) { -if (delBook.equals(BookInfo[i][1])) { -index=i; -break; -} -} -BookInfo[index][0]=null; -BookInfo[index][1]=null; -BookInfo[index][2]=null; -BookInfo[index][3]=null; -BookInfo[index][4]=null; -System.out.println("删除成功!"); -BookManage(); -} - -private static void increase() {//增加 -int index=-1; -for (int i = 0; i < BookInfo.length; i++) { -if(BookInfo[i][0]==null) { -index=i; -break; -} - -} -System.out.println("请输入图书ISBN:"); -String ISBN=arr.next(); -for (int i = 0; i < BookInfo.length; i++) { -if (ISBN.equals(BookInfo[i][0])) { -System.out.println("图书已存在"); -BookManage(); -}else { -BookInfo[index][0]=ISBN; -System.out.println("请输入书名:"); -BookInfo[index][1]=arr.next(); -System.out.println("请输入价格:"); -BookInfo[index][2]=arr.next(); -System.out.println("请输入出版社:"); -BookInfo[index][3]=arr.next(); -System.out.println("请输入作者:"); -BookInfo[index][4]=arr.next(); -System.out.println("添加成功!"); -} - -} - - -BookManage(); - -} - -private static void register() {//注册 -System.out.println("请输入所属部门:"); -String apartment =arr.next(); -System.out.println("请输入用户角色:"); -String name =arr.next(); -System.out.println("请输入用户名:"); -String user =arr.next(); -System.out.println("请输入密码:"); -String password =arr.next(); -System.out.println("注册成功!"); -System.out.println(user+","+"欢迎来到闽大图书管理系统!"); - -int index=-1; -for (int i = 0; i < userinfo.length; i++) { -if(userinfo[i][0]==null) { -index=i; -break; -} -} -userinfo[index][0]=apartment; -userinfo[index][1]=name; -userinfo[index][2]=user; -userinfo[index][3]=password; -head(); -} -private static boolean isExist(String[][] arr,int index,String isbn) { -boolean flag=false; -for (int i = 0; i < arr.length; i++) { -if (isbn.equals(BookInfo[i][2])) { -flag=true; -break; -} -} -return flag; -} - - -} \ No newline at end of file -- Gitee From 6350d9ba048789b8712dc64e12c713dfbec05c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=96=E7=BA=B7?= <8332024+o2444091281@user.noreply.gitee.com> Date: Thu, 6 May 2021 10:40:51 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=BB=84=E9=94=9F=E5=AE=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Apr26.bat" | 1 + .../Apr26.class" | Bin 0 -> 11481 bytes ...\344\271\246\347\256\241\347\220\206.java" | 561 ++++++++++++++++++ 3 files changed, 562 insertions(+) create mode 100644 "Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/Apr26.bat" create mode 100644 "Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/Apr26.class" create mode 100644 "Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/\345\233\276\344\271\246\347\256\241\347\220\206.java" diff --git "a/Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/Apr26.bat" "b/Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/Apr26.bat" new file mode 100644 index 0000000..14c53ec --- /dev/null +++ "b/Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/Apr26.bat" @@ -0,0 +1 @@ +java Apr26 \ No newline at end of file diff --git "a/Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/Apr26.class" "b/Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/Apr26.class" new file mode 100644 index 0000000000000000000000000000000000000000..9eac7eeb6dba2502170a4a3ec10dc7dcb124013f GIT binary patch literal 11481 zcma)C31C#^wLa(GS#H8Wk_myZ=>W0?NF+c2SyaRY4WLFAMZ_T)AdrnLC@yW($POZc z$fkh6P%Arf(}|f&FpbG^U3pQ!O|B#Y5*~8uk=H{}SVs?8 zB{QYu7ncPl*Obl)RNmpAQxahE=9d@xOQ!iNi{)7XlgXsMvb_gHR?jc4VshszhJy`` zQokV9sec=M9WX5!XASbuU|E_hh!y)wiXR9FILAX*svYMC{6*NuUpWsOr?;_<1u;`n z^QnW44ad(vw$GwGAg&+7Cu_q`JQ;rS8H+|j3(EYZfgu)M1(6KN9cs}Stc$#~s`=nX zwGN_+KB^VhL|5cmG#*2LQE73RMH57uhTzYl8!*3V^QrLeZOuDZTXYi>19~%dFRa2K zA2Y}2;?JVVOrFNjityG`k&_!5UtVF+t(c4#x2wq*+=0p04aJ{D(3Pafp<|Jk);FHq zVbKiC1oSR76N9_eUi-sq);7MpH+;C(qI;Nngja8BJn>>U^k~!CRpArc8c%Et?+!Na z+%z;V{6xJ)_d@dFlRJQeMRUNO##7tE2aboAooHIIylMAoi@@SO=l5=ogbp^oy#4&? z&CP4-Biq+Tjx~fgE^Q2LX$XJ7{-Q^*^g@? zQ~QEyf8oMO{t9IS7Ci=3nh(}DpMEO*_@1T>`y$Kh!|T?3esYVP`M8Ic(lThVoCz<} ze?V(5W6=tjm%T;!;L@fYkEr#lXpNgzw={j_nLMsL8V1o!K*<6*zTcc={cb4uc!!=LD>c;ZWa?;tIeYLz=N%)ogUgHJhZCI^?VV~ zZV&Ad0VU-Z&#ClRE}1mRq9As+1rS;OwC3db4V#+}9t7p!@cCtHB2ORE903H&5do?y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}{5AEhn$TB^7r&-r*xX!VLqN@(?J zk5sN^tFSYu?WXO2Zbe8JSh*$S;aSQDA@dd~ry!|zN^?R6E@@6AbbRkZHAqH#N-{c7 zs*yrnj8ybo)2P4Ur5q!jMi?DwoRL8{8l5O$;1_~M7b-Kl(h{Q^J#2KRT0E~dE~kx# zkDfJpQqbr{hm78k!xf76(sxLu-MmQIf)9L_E)aeZN{@3TMg~H}Vy?o-gjdN|GIA)d zB9@~24&BLd5x?n?hJ*dzb|naA_=SX)3GK!%(%b8Aj#DK|*FjKrAwTLb9H_=TQ?Sss?ohU_DrJi~9hEY^=i(adWANht1v~>J(f|Me literal 0 HcmV?d00001 diff --git "a/Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/\345\233\276\344\271\246\347\256\241\347\220\206.java" "b/Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/\345\233\276\344\271\246\347\256\241\347\220\206.java" new file mode 100644 index 0000000..f1354cf --- /dev/null +++ "b/Java\351\241\271\347\233\256_\347\274\226\350\257\221\347\211\210/\347\254\2544\345\260\217\347\273\204/\351\273\204\351\224\237\345\256\207/\345\233\276\344\271\246\347\256\241\347\220\206.java" @@ -0,0 +1,561 @@ +import java.awt.print.Book; +import java.lang.invoke.SwitchPoint; +import java.lang.reflect.Array; +import java.util.IllegalFormatCodePointException; +import java.util.Scanner; + +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT; + +public class Apr26 { +static String userinfo[][]=new String[100][4]; +static String BookInfo[][]=new String[100][5]; +static String PressInfo[][]=new String[100][3]; +static Scanner arr =new Scanner(System.in); + +public static void main(String[] args) { +// TODO 自动生成的方法存根 +initialize();//初始化 +head();//登录--注册 +} + +private static void initialize() {//初始化 +userinfo [0] [0]="软件部"; +userinfo [0] [1]="软件开发员"; +userinfo [0] [2]="name1"; +userinfo [0] [3]="123"; + +userinfo [1] [0]="测试部"; +userinfo [1] [1]="测试员"; +userinfo [1] [2]="name2"; +userinfo [1] [3]="123"; + +userinfo [2] [0]="测试部"; +userinfo [2] [1]="测试员"; +userinfo [2] [2]="admin"; +userinfo [2] [3]="123"; + +BookInfo[0][0]="A1111"; +BookInfo[0][1]="白夜行"; +BookInfo[0][2]="1"; +BookInfo[0][3]="cs1"; +BookInfo[0][4]="1"; + +BookInfo[1][0]="B2222"; +BookInfo[1][1]="三国演义"; +BookInfo[1][2]="2"; +BookInfo[1][3]="cs2"; +BookInfo[1][4]="2"; + +BookInfo[1][0]="C3333"; +BookInfo[1][1]="水浒传"; +BookInfo[1][2]="3"; +BookInfo[1][3]="cs3"; +BookInfo[1][4]="3"; + +PressInfo[0][0]="中华书局"; +PressInfo[0][1]="北京市王府井大街36号"; +PressInfo[0][2]="张三"; + +PressInfo[1][0]="作家出版社"; +PressInfo[1][1]="香港九龙荷李活商业中心8楼"; +PressInfo[1][2]="李四"; +} +private static void head() {// 登录--注册 +System.out.println("欢迎来到闽大图书管理系统!"); +System.out.println("1.登录 2.注册"); +int a= arr.nextInt(); +switch(a) { +case 1: +enter(); +break; +case 2: +register(); +break; +} + +} + +private static void enter() {//登录 +System.out.println("请输入用户名:"); +String usesrName=arr.next(); +System.out.println("请输入密码:"); +String parkword=arr.next(); +boolean judge=false; + +for (int i = 0; i < userinfo.length; i++) { +if (usesrName.equals(userinfo[i][2]) && parkword.equals(userinfo[i][3])) { +judge=true; +break; +} +} +if (judge) { +System.out.println("登录成功!"); +System.out.println(usesrName+","+"欢迎来到闽大图书管理系统!"); +LibraryMM(); +}else { +System.out.println("用户名或密码错误!请重新登录!"); +head(); +} + +} + + +private static void LibraryMM() {//图书管理系统 +System.out.println("请输入数字进行选择:1 图书管理 2 出版社管理 3 退出登录 4 退出系统"); +int a= arr.nextInt(); +switch(a) { +case 1: +BookManage();//图书管理 +break; +case 2: +publishingHouse();//出版社管理 +case 3: +head();//出版设管理 +break; +case 4: +System.exit(0);//退出系统 +break; +} + +} + +private static void publishingHouse() {//出版设管理 +System.out.println("请输入:1.增加 2.删除 3.更新 4.根据出版社名称查询 5.查询所有出版社 6.返回上一级菜单"); +int a= arr.nextInt(); +switch(a) { +case 1://增加 +increase2(); +break; +case 2://删除 +remove2(); +break; +case 3://更新 +update2(); +break; +case 4://查询 +NameQuery(); +case 5: +System.out.println("出版社名称 地址 联系人"); +for (int i = 0; i < PressInfo.length; i++) { +if(PressInfo[i][0]==null) { +break; +} + +for (int j = 0; j < PressInfo[i].length; j++) { +System.out.print(PressInfo[i][j]+" "); +} +System.out.println(); +} +case 6: +LibraryMM(); +break; +} +} + +private static void BookManage() {//图书管理 +System.out.println("请输入:1.增加 2.删除 3.更新 4.查询 5.返回上一级菜单"); +int a= arr.nextInt(); +switch(a) { +case 1://增加 +increase(); +break; +case 2://删除 +remove(); +case 3://更新 +update(); +break; +case 4://查询 +inquire(); +case 5: +LibraryMM(); +break; +} + +} +private static void NameQuery() { +System.out.println("请输入出版社名称:"); +String name=arr.next(); +for (int i = 0; i < PressInfo.length; i++) { +if (name.equals(PressInfo[i][0])) { +System.out.println("出版社名称:"+name); +System.out.println("出版社地址:"+PressInfo[i][1]); +System.out.println("出版社联系人:"+PressInfo[i][2]); +LibraryMM(); +break; +}else { +System.out.println("请输入正确的出版社名称"); +publishingHouse(); +} +} +} +private static void update2() {//出版社更新 +System.out.println("请输入要更新的出版社名称:"); +String updateName=arr.next(); + for (int i = 0; i < PressInfo.length; i++) { +if (updateName.equals(PressInfo[i][0])) { +System.out.println("请输入要更新的地址:"); +String newddress =arr.next(); +System.out.println("请输入要更新的联系人姓名:"); +String newName=arr.next(); +System.out.println("更新成功"); +System.out.println("出版社名称 地址 联系人"); +System.out.println(updateName+" "+newddress+" "+newName); +int index=-1; +for (int j = 0; j < PressInfo.length; j++) { +if(userinfo[j][0]==null) { +index=j; +break; +} +} +PressInfo[index][1]=newddress; +PressInfo[index][2]=newName; +LibraryMM(); +}else { +System.out.println("没查找到这个出版社,请重新输入"); +LibraryMM(); +} +} + + +} + +private static void remove2() {//出版社删除 +System.out.println("请输入要删除的出版社名称:"); +String delName=arr.next(); +isExist(PressInfo, 0, delName); +int index=-1; +for (int i = 0; i < PressInfo.length; i++) { +if (delName.equals(PressInfo[i][0])) { +index=i; +break; +} +} + +PressInfo[index][0]=null; +PressInfo[index][1]=null; +PressInfo[index][2]=null; +System.out.println("删除成功!"); +LibraryMM(); + +} + +private static void increase2() {//出版社增加 + int index=-1; + for (int i = 0; i < PressInfo.length; i++) { + if(PressInfo[i][0]==null) { + index=i; + break; + } + + } +System.out.println("请输入出版社名称:"); +PressInfo[index][0]=arr.next(); +System.out.println("请输入出版社地址:"); +PressInfo[index][1]=arr.next(); +System.out.println("请输入出版社联系人:"); +PressInfo[index][2]=arr.next(); +System.out.println("出版社添加成功"); +LibraryMM(); + +} +private static void inquire() {//查询 +System.out.println("请输入查询种类:1.isbn 2.书名(模糊) 3.出版社 4. 作者 5. 价格范围 6.查询所有 7.返回上一级 "); +int a=arr.nextInt(); +switch (a) { +case 1: +System.out.println("请输入ISBN号:"); +String isbn=arr.next(); +for (int i = 0; i < BookInfo.length; i++) { +if (isbn.equals(BookInfo[i][0])) { +System.out.println("ISBN 书名 价格 出版社 作者"); +System.out.print(BookInfo[i][0]); +System.out.print(" "); +System.out.print(BookInfo[i][1]); +System.out.print(" "); +System.out.print(BookInfo[i][2]); +System.out.print(" "); +System.out.print(BookInfo[i][3]); +System.out.print(" "); +System.out.print(BookInfo[i][4]); +System.out.println(); +inquire(); +break; +}else { +System.out.println("请输入正确的ISBN"); +inquire(); +} +} +break; +case 2: +System.out.println("请输入书名:"); +String book=arr.next(); +for (int i = 0; i < BookInfo.length; i++) { +if (BookInfo!=null && BookInfo[i][1].indexOf(book)!=-1) { +System.out.println("ISBN 书名 价格 出版社 作者"); +System.out.print(BookInfo[i][0]); +System.out.print(" "); +System.out.print(BookInfo[i][1]); +System.out.print(" "); +System.out.print(BookInfo[i][2]); +System.out.print(" "); +System.out.print(BookInfo[i][3]); +System.out.print(" "); +System.out.print(BookInfo[i][4]); +System.out.println(); +inquire(); +break; +}else { +System.out.println("请输入正确的书名"); +inquire(); +} +} +break; +case 3: + PressInquiry(); +//System.out.println("请输入出版社:"); +//String press=arr.next(); +//for (int i = 0; i < PressInfo.length; i++) { +//if (press.equals(BookInfo[i][2])) { +//System.out.println("ISBN 书名 价格 出版社 作者"); +//System.out.print(BookInfo[i][0]); +//System.out.print(" "); +//System.out.print(BookInfo[i][1]); +//System.out.print(" "); +//System.out.print(BookInfo[i][2]); +//System.out.print(" "); +//System.out.print(BookInfo[i][3]); +//System.out.print(" "); +//System.out.print(BookInfo[i][4]); +//System.out.println(); +//inquire(); +//break; +//}else { +//System.out.println("请输入正确的出版社"); +//inquire(); +//} +//} +break; +case 4: +System.out.println("请输入作者:"); +String worker=arr.next(); +for (int i = 0; i < BookInfo.length; i++) { +if (worker.equals(BookInfo[i][3])) { +System.out.println("ISBN 书名 价格 出版社 作者"); +System.out.print(BookInfo[i][0]); +System.out.print(" "); +System.out.print(BookInfo[i][1]); +System.out.print(" "); +System.out.print(BookInfo[i][2]); +System.out.print(" "); +System.out.print(BookInfo[i][3]); +System.out.print(" "); +System.out.print(BookInfo[i][4]); +System.out.println(); +inquire(); +break; +}else { +System.out.println("请输入正确的作者"); +inquire(); +} +} + +break; +case 5: +System.out.println("请输入查询的价格区间:"); +double money1=arr.nextDouble(); +double money2=arr.nextDouble(); +for (int i = 0; i < BookInfo.length; i++) { +double price = Double.parseDouble(BookInfo[i][4]); +if (money1<=price && money2>=price) { +System.out.println("ISBN 书名 价格 出版社 作者"); +System.out.print(BookInfo[i][0]); +System.out.print(" "); +System.out.print(BookInfo[i][1]); +System.out.print(" "); +System.out.print(BookInfo[i][2]); +System.out.print( " "); +System.out.print(BookInfo[i][3]); +System.out.print(" "); +System.out.print(BookInfo[i][4]); +System.out.println(); +inquire(); +break; +} +} + +break; +case 6: +System.out.println("ISBN 书名 价格 出版社 作者"); +for (int i = 0; i < BookInfo.length; i++) { +if(BookInfo[i][0]==null) { +break; +} + +for (int j = 0; j < BookInfo[i].length; j++) { +System.out.print(BookInfo[i][j]+" "); +} +System.out.println(); +} + +break; +case 7: +BookManage() ; +break; + +default: +break; +} +} + +private static void PressInquiry() { + // 出版社查询 + + String[][] pubs = new String[PressInfo.length][3]; + + + for (int i = 0; i < pubs.length; i++) { + if (PressInfo[i][0]!=null) { + pubs[i] = PressInfo[i]; + } + } + for (int i = 0; i < pubs.length; i++) { + if (pubs[i][0]!=null) { + System.out.print((i+1)+"."+pubs[i][0]+" "); + } + } + System.out.println(); + System.out.println("请选择出版社"); + int key = arr.nextInt(); + System.out.println("ISBN\t书名\t价格\t出版社\t作者"); + for (int i = 0; i < BookInfo.length; i++) { + if (pubs[key-1][0].equals(BookInfo[i][3])) { + System.out.println(BookInfo[i][0]+"\t"+BookInfo[i][1]+"\t"+BookInfo [i][2] + +"\t"+BookInfo[i][3]+"\t"+BookInfo[i][4]); + } + } +} + +private static void update() {//更新 +System.out.println("请输入ISBN号:"); +String updateISBN=arr.next(); + for (int i = 0; i < BookInfo.length; i++) { +if (updateISBN.equals(BookInfo[i][0])) { +System.out.println("请输入新的书名:"); +String newName =arr.next(); +System.out.println("请输入新的价格:"); +String newMoney=arr.next(); +System.out.println("请输入新的出版社:"); +String newpublishing=arr.next(); +System.out.println("请输入新的作者:"); +String newWorker=arr.next(); +int index=-1; +for (int j = 0; j < BookInfo.length; j++) { +if(userinfo[j][0]==null) { +index=j; +break; +} +} +userinfo[index][1]=newName; +userinfo[index][2]=newMoney; +userinfo[index][3]=newpublishing; +userinfo[index][4]=newWorker; +}else { +System.out.println("没查找到这个ISBN,请重新输入"); + BookManage() ; +} +} + +} + +private static void remove() {//删除 +System.out.println("请输入要删除的书本名称:"); +String delBook=arr.next(); +int index=-1; +for (int i = 0; i < BookInfo.length; i++) { +if (delBook.equals(BookInfo[i][1])) { +index=i; +break; +} +} +BookInfo[index][0]=null; +BookInfo[index][1]=null; +BookInfo[index][2]=null; +BookInfo[index][3]=null; +BookInfo[index][4]=null; +System.out.println("删除成功!"); +BookManage(); +} + +private static void increase() {//增加 +int index=-1; +for (int i = 0; i < BookInfo.length; i++) { +if(BookInfo[i][0]==null) { +index=i; +break; +} + +} +System.out.println("请输入图书ISBN:"); +String ISBN=arr.next(); +for (int i = 0; i < BookInfo.length; i++) { +if (ISBN.equals(BookInfo[i][0])) { +System.out.println("图书已存在"); +BookManage(); +}else { +BookInfo[index][0]=ISBN; +System.out.println("请输入书名:"); +BookInfo[index][1]=arr.next(); +System.out.println("请输入价格:"); +BookInfo[index][2]=arr.next(); +System.out.println("请输入出版社:"); +BookInfo[index][3]=arr.next(); +System.out.println("请输入作者:"); +BookInfo[index][4]=arr.next(); +System.out.println("添加成功!"); +} + +} + + +BookManage(); + +} + +private static void register() {//注册 +System.out.println("请输入所属部门:"); +String apartment =arr.next(); +System.out.println("请输入用户角色:"); +String name =arr.next(); +System.out.println("请输入用户名:"); +String user =arr.next(); +System.out.println("请输入密码:"); +String password =arr.next(); +System.out.println("注册成功!"); +System.out.println(user+","+"欢迎来到闽大图书管理系统!"); + +int index=-1; +for (int i = 0; i < userinfo.length; i++) { +if(userinfo[i][0]==null) { +index=i; +break; +} +} +userinfo[index][0]=apartment; +userinfo[index][1]=name; +userinfo[index][2]=user; +userinfo[index][3]=password; +head(); +} +private static boolean isExist(String[][] arr,int index,String isbn) { +boolean flag=false; +for (int i = 0; i < arr.length; i++) { +if (isbn.equals(BookInfo[i][2])) { +flag=true; +break; +} +} +return flag; +} + + +} \ No newline at end of file -- Gitee