欢迎来到天天文库
浏览记录
ID:49286660
大小:16.50 KB
页数:3页
时间:2020-03-01
《酒店管理系统JAVA代码.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、importjava.util.Scanner;importorg.omg.CORBA.PUBLIC_MEMBER;publicclassjiudian{staticString[][]rooms;publicstaticvoidmain(String[]args){rooms=newString[8][8];for(inti=0;i2、nnerscanner=newScanner(System.in);while(true){System.out.println("ÇëÊäÈëÃüÁ");command=scanner.nextLine();if(command.equals("search")){searchRoom();}elseif(command.equals("in")){System.out.println("ÇëÊäÈëÄúÐèÒªÈëסµÄ·¿¼äºÅ£º");StringroomIDString=scanner.nextLi3、ne();introomID=Integer.parseInt(roomIDString);System.out.println("ÇëÊäÈëÄúµÄÐÕÃû£º");StringuserName=scanner.nextLine();inRoom(roomID,userName);}elseif(command.equals("out")){System.out.println("ÇëÊäÈëÄúÐèÒªÍ˶©µÄ·¿¼äºÅ£º");StringroomIDString=scanner.nextLine();i4、ntroomID=Integer.parseInt(roomIDString);outRoom(roomID);}elseif(command.equals("quit")){System.out.println("»¶ÓÔÙ´ÎʹÓÃ");System.exit(0);}else{System.out.println("ÊäÈëÃüÁîÓÐÎó£¬ÇëÖØÐÂÊäÈ룡");}}精选范本,供参考!}publicstaticvoidsearchRoom(){for(inti=0;i5、){//Êä³ö·¿¼äºÅfor(intj=0;j6、e){if(isRoomNull(roomID)){//·¿¼äΪ¿Õ//·¿¼ä״̬£ºNULL-->userNameinti=roomID/100-1;intj=roomID%100-1;rooms[i][j]=userName;System.out.println(userName+"³É¹¦Èëס"+roomID);}else{//·¿¼ä²»Îª¿ÕSystem.out.println("¸Ã·¿¼äÒѾÓÐÈË£¬ÇëÖØÐÂÑ¡Ôñ£¡");}}publicstaticvoidoutRoom(i7、ntroomID){if(isRoomNull(roomID)){//·¿¼äΪ¿ÕSystem.out.println("·¿¼äΪ¿ÕÎÞÐèÍË·¿");}else{//·¿¼ä²»Îª¿Õ//·¿¼ä״̬£ºuserName-->NULLinti=roomID/100-1;intj=roomID%100-1;rooms[i][j]="NULL";System.out.println(roomID+"ÍË·¿³É¹¦!");}精选范本,供参考!}privatestaticbooleanisRoomNull8、(introomID){//801-->i=7j=0-->rooms[7][0]inti=roomID/100-1;intj=roomID%100-1;if(rooms[i][j].equals("NULL")){returntrue;}else{returnfalse;}}}【本文档内容可以自由复制内容或自由编辑修改内容期待你的
2、nnerscanner=newScanner(System.in);while(true){System.out.println("ÇëÊäÈëÃüÁ");command=scanner.nextLine();if(command.equals("search")){searchRoom();}elseif(command.equals("in")){System.out.println("ÇëÊäÈëÄúÐèÒªÈëסµÄ·¿¼äºÅ£º");StringroomIDString=scanner.nextLi
3、ne();introomID=Integer.parseInt(roomIDString);System.out.println("ÇëÊäÈëÄúµÄÐÕÃû£º");StringuserName=scanner.nextLine();inRoom(roomID,userName);}elseif(command.equals("out")){System.out.println("ÇëÊäÈëÄúÐèÒªÍ˶©µÄ·¿¼äºÅ£º");StringroomIDString=scanner.nextLine();i
4、ntroomID=Integer.parseInt(roomIDString);outRoom(roomID);}elseif(command.equals("quit")){System.out.println("»¶ÓÔÙ´ÎʹÓÃ");System.exit(0);}else{System.out.println("ÊäÈëÃüÁîÓÐÎó£¬ÇëÖØÐÂÊäÈ룡");}}精选范本,供参考!}publicstaticvoidsearchRoom(){for(inti=0;i5、){//Êä³ö·¿¼äºÅfor(intj=0;j6、e){if(isRoomNull(roomID)){//·¿¼äΪ¿Õ//·¿¼ä״̬£ºNULL-->userNameinti=roomID/100-1;intj=roomID%100-1;rooms[i][j]=userName;System.out.println(userName+"³É¹¦Èëס"+roomID);}else{//·¿¼ä²»Îª¿ÕSystem.out.println("¸Ã·¿¼äÒѾÓÐÈË£¬ÇëÖØÐÂÑ¡Ôñ£¡");}}publicstaticvoidoutRoom(i7、ntroomID){if(isRoomNull(roomID)){//·¿¼äΪ¿ÕSystem.out.println("·¿¼äΪ¿ÕÎÞÐèÍË·¿");}else{//·¿¼ä²»Îª¿Õ//·¿¼ä״̬£ºuserName-->NULLinti=roomID/100-1;intj=roomID%100-1;rooms[i][j]="NULL";System.out.println(roomID+"ÍË·¿³É¹¦!");}精选范本,供参考!}privatestaticbooleanisRoomNull8、(introomID){//801-->i=7j=0-->rooms[7][0]inti=roomID/100-1;intj=roomID%100-1;if(rooms[i][j].equals("NULL")){returntrue;}else{returnfalse;}}}【本文档内容可以自由复制内容或自由编辑修改内容期待你的
5、){//Êä³ö·¿¼äºÅfor(intj=0;j6、e){if(isRoomNull(roomID)){//·¿¼äΪ¿Õ//·¿¼ä״̬£ºNULL-->userNameinti=roomID/100-1;intj=roomID%100-1;rooms[i][j]=userName;System.out.println(userName+"³É¹¦Èëס"+roomID);}else{//·¿¼ä²»Îª¿ÕSystem.out.println("¸Ã·¿¼äÒѾÓÐÈË£¬ÇëÖØÐÂÑ¡Ôñ£¡");}}publicstaticvoidoutRoom(i7、ntroomID){if(isRoomNull(roomID)){//·¿¼äΪ¿ÕSystem.out.println("·¿¼äΪ¿ÕÎÞÐèÍË·¿");}else{//·¿¼ä²»Îª¿Õ//·¿¼ä״̬£ºuserName-->NULLinti=roomID/100-1;intj=roomID%100-1;rooms[i][j]="NULL";System.out.println(roomID+"ÍË·¿³É¹¦!");}精选范本,供参考!}privatestaticbooleanisRoomNull8、(introomID){//801-->i=7j=0-->rooms[7][0]inti=roomID/100-1;intj=roomID%100-1;if(rooms[i][j].equals("NULL")){returntrue;}else{returnfalse;}}}【本文档内容可以自由复制内容或自由编辑修改内容期待你的
6、e){if(isRoomNull(roomID)){//·¿¼äΪ¿Õ//·¿¼ä״̬£ºNULL-->userNameinti=roomID/100-1;intj=roomID%100-1;rooms[i][j]=userName;System.out.println(userName+"³É¹¦Èëס"+roomID);}else{//·¿¼ä²»Îª¿ÕSystem.out.println("¸Ã·¿¼äÒѾÓÐÈË£¬ÇëÖØÐÂÑ¡Ôñ£¡");}}publicstaticvoidoutRoom(i
7、ntroomID){if(isRoomNull(roomID)){//·¿¼äΪ¿ÕSystem.out.println("·¿¼äΪ¿ÕÎÞÐèÍË·¿");}else{//·¿¼ä²»Îª¿Õ//·¿¼ä״̬£ºuserName-->NULLinti=roomID/100-1;intj=roomID%100-1;rooms[i][j]="NULL";System.out.println(roomID+"ÍË·¿³É¹¦!");}精选范本,供参考!}privatestaticbooleanisRoomNull
8、(introomID){//801-->i=7j=0-->rooms[7][0]inti=roomID/100-1;intj=roomID%100-1;if(rooms[i][j].equals("NULL")){returntrue;}else{returnfalse;}}}【本文档内容可以自由复制内容或自由编辑修改内容期待你的
此文档下载收益归作者所有