欢迎来到天天文库
浏览记录
ID:50961177
大小:50.50 KB
页数:9页
时间:2020-03-16
《酒店查询系统.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、importjava.util.*;publicclassHotelManageSystem{publicstaticvoidmain(String[]args){Managerm=newManager("严伟","经理001");Cookerc=newCooker("朱闯","厨师001");Waiterw1=newWaiter("张三","服务员001");Waiterw2=newWaiter("李四","服务员002");ArrayListal=newArrayList2、yee>();al.add(m);al.add(c);al.add(w1);al.add(w2);while(true){System.out.println("========黑马大酒店管理系统=======");System.out.println("1.员工管理界面...");System.out.println("2.幸运员工随机...");System.out.println("3.酒店Vip服务...");System.out.println("4.退出系统...");intnum=choice3、();if(num==1){manageEmployeeSystem(al);}elseif(num==2){Employeee=rdLuck(al);System.out.println("幸运员工是...."+e.getName()+"....编号是:"+e.getId());}elseif(num==3){vip(al);}elseif(num==4){System.out.println("谢谢使用本系统");return;}}}//人员管理系统publicstaticvoidmanageEmplo4、yeeSystem(ArrayListal){while(true){System.out.println("========酒店人员管理界面=======");System.out.println("1.添加员工");System.out.println("2.删除员工");System.out.println("3.查询员工");System.out.println("4.修改员工");System.out.println("5.返回");intnum=choice();if(num5、==1){addEmployeeSystem(al);}elseif(num==2){delEmployeeSystem(al);}elseif(num==3){searchEmployeeSystem(al);}elseif(num==4){replaceEmployeeSystem(al);}elseif(num==5){return;}else{System.out.println("输入错误请重新输入");}}}//选择需要修改的内容publicstaticvoidreplaceEmployee(i6、nti,ArrayListal){intnum=0;System.out.println("========修改员工职位界面=======");System.out.println("1.经理");System.out.println("2.厨师");System.out.println("3.服务员");System.out.println("4.返回");num=choice();if(num==1){setEmployee(i,al,newManager());}elseif(nu7、m==2){setEmployee(i,al,newCooker());}elseif(num==3){setEmployee(i,al,newWaiter());}elseif(num==4){return;}else{System.out.println("输入错误请重新输入");}}//修改员工职位publicstaticvoidsetEmployee(intnum,ArrayListal,Employeee){Scannersc=newScanner(System.in);Sys8、tem.out.println("请输入姓名");e.setName(sc.next());System.out.println("请输入编号");e.setId(sc.next());if(einstanceofManager){System.out.println("请输入需要修改的经理奖金");((Manager)e).setBonus(sc.nextInt());}al.set(num,e);}//修改员
2、yee>();al.add(m);al.add(c);al.add(w1);al.add(w2);while(true){System.out.println("========黑马大酒店管理系统=======");System.out.println("1.员工管理界面...");System.out.println("2.幸运员工随机...");System.out.println("3.酒店Vip服务...");System.out.println("4.退出系统...");intnum=choice
3、();if(num==1){manageEmployeeSystem(al);}elseif(num==2){Employeee=rdLuck(al);System.out.println("幸运员工是...."+e.getName()+"....编号是:"+e.getId());}elseif(num==3){vip(al);}elseif(num==4){System.out.println("谢谢使用本系统");return;}}}//人员管理系统publicstaticvoidmanageEmplo
4、yeeSystem(ArrayListal){while(true){System.out.println("========酒店人员管理界面=======");System.out.println("1.添加员工");System.out.println("2.删除员工");System.out.println("3.查询员工");System.out.println("4.修改员工");System.out.println("5.返回");intnum=choice();if(num
5、==1){addEmployeeSystem(al);}elseif(num==2){delEmployeeSystem(al);}elseif(num==3){searchEmployeeSystem(al);}elseif(num==4){replaceEmployeeSystem(al);}elseif(num==5){return;}else{System.out.println("输入错误请重新输入");}}}//选择需要修改的内容publicstaticvoidreplaceEmployee(i
6、nti,ArrayListal){intnum=0;System.out.println("========修改员工职位界面=======");System.out.println("1.经理");System.out.println("2.厨师");System.out.println("3.服务员");System.out.println("4.返回");num=choice();if(num==1){setEmployee(i,al,newManager());}elseif(nu
7、m==2){setEmployee(i,al,newCooker());}elseif(num==3){setEmployee(i,al,newWaiter());}elseif(num==4){return;}else{System.out.println("输入错误请重新输入");}}//修改员工职位publicstaticvoidsetEmployee(intnum,ArrayListal,Employeee){Scannersc=newScanner(System.in);Sys
8、tem.out.println("请输入姓名");e.setName(sc.next());System.out.println("请输入编号");e.setId(sc.next());if(einstanceofManager){System.out.println("请输入需要修改的经理奖金");((Manager)e).setBonus(sc.nextInt());}al.set(num,e);}//修改员
此文档下载收益归作者所有