欢迎来到天天文库
浏览记录
ID:12508888
大小:312.50 KB
页数:13页
时间:2018-07-17
《java书店管理系统源代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Java源代码publicclassloaduser{publicStringuser;publicStringpassword;booleanb1;loaduser(Strings1,Strings2){user=s1;password=s2;}voidload(){System.out.println("书店管理销售系统");System.out.println("**************************************");System.out.println("1、登录系统");System
2、.out.println("2、退出系统");System.out.println("**************************************");System.out.println("请选择:");intm;Scanners=newScanner(System.in);m=s.nextInt();if(m==1){for(inti=0;i<3;i++){System.out.println("请输入账户名和密码");Strings3,s4;Scannerss=newScanner(System.
3、in);s3=s.next();s4=s.next();if(user.equals(s3)&&password.equals(s4))b1=true;elseb1=false;if(i==0&&b1==false)System.out.println("用户名或密码输入错误一次,还有两次机会!");if(i==1&&b1==false)System.out.println("用户名或密码输入错误两次,还有一次机会!");if(i==2&&b1==false){System.out.println("三次输入错误,退出
4、系统!");System.exit(0);}if(b1==true){System.out.println("登录成功!");break;}}}if(m==2)System.exit(0);}packagemanger;importjava.util.ArrayList;importjava.util.Scanner;importmanger.vip;importSystem.menu;publicclassvipmanger{staticArrayListvipgroup=newArrayList
5、();publicvipmanger(){vipgroup.add(newvip("001","王芳",100));vipgroup.add(newvip("002","李娜",60));vipgroup.add(newvip("003","杨丽",50));vipgroup.add(newvip("004","孙洁",150));vipgroup.add(newvip("005","肖青",300));}staticvoidaddd(){System.out.println("请一次输入编号,姓名,积分");Stri
6、ngS1,S2;intA;Scanners=newScanner(System.in);S1=s.next();S2=s.next();A=s.nextInt();vipv1=newvip(S1,S2,A);vipgroup.add(v1);}staticvoiddelete(){System.out.println("请输入要求删除的会员编号:");Strings;Scannerme=newScanner(System.in);s=me.next();booleanb1=true;for(inti=0;i7、oup.size();i++)if(s.equals(vipgroup.get(i).ID)){vipgroup.remove(i);b1=false;}if(b1)System.out.println("查无此会员!");}staticvoidcorrect(){System.out.println("请输入要修改信息的会员编号:");Stringsss;Scanners=newScanner(System.in);sss=s.next();booleanb1=true;for(inti=0;i8、ize();i++)if(sss.equals(vipgroup.get(i).ID)){b1=false;System.out.println("请输入新的姓名和积分:");Stringss1;Scanners7=newScanner(System.in);ss1=s7.next();vipgroup.get(i).name=s
7、oup.size();i++)if(s.equals(vipgroup.get(i).ID)){vipgroup.remove(i);b1=false;}if(b1)System.out.println("查无此会员!");}staticvoidcorrect(){System.out.println("请输入要修改信息的会员编号:");Stringsss;Scanners=newScanner(System.in);sss=s.next();booleanb1=true;for(inti=0;i8、ize();i++)if(sss.equals(vipgroup.get(i).ID)){b1=false;System.out.println("请输入新的姓名和积分:");Stringss1;Scanners7=newScanner(System.in);ss1=s7.next();vipgroup.get(i).name=s
8、ize();i++)if(sss.equals(vipgroup.get(i).ID)){b1=false;System.out.println("请输入新的姓名和积分:");Stringss1;Scanners7=newScanner(System.in);ss1=s7.next();vipgroup.get(i).name=s
此文档下载收益归作者所有