欢迎来到天天文库
浏览记录
ID:34253294
大小:46.72 KB
页数:20页
时间:2019-03-04
《java购物系统源代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、.1StartSMS.javapackagecn.itcast;importjava.util.Scanner;/***系统开启类**@authorAdministrator**/publicclassStartSMS{publicStartSMS(){}publicstaticvoidmain(Stringargs[]){Datadata=newData();data.ini();Menumenu=newMenu();menu.setData(data.goodsName,data.goodsPrice,data.custNo,data.custBirth,d
2、ata.custScore);menu.showLoginMenu();booleanflag=true;label0:do{if(!flag)break;Scannerscanner=newScanner(System.in);inti=scanner.nextInt();VerifyEqualverifyequal=newVerifyEqual();switch(i){case1://' 01'intj=3;do{if(j<1)continuelabel0;if(verifyequal.verify(data.manager.username,data.m
3、anager.password)){menu.showMainMenu();continuelabel0;}if(j!=1){System.out.println("用户名和密码不匹配,请重新输入:");...}else{System.out.println("您没有权限进入系统!谢谢!");flag=false;}j--;}while(true);case2://' 02'if(verifyequal.verify(data.manager.username,data.manager.password)){System.out.print("请输入新
4、的用户名:");data.manager.username=scanner.next();System.out.print("请输入新的密码:");data.manager.password=scanner.next();System.out.println("用户名和密码已更改!");System.out.println("请选择,输入数字:");}else{System.out.println("抱歉,你没有权限修改!");flag=false;}break;case3://' 03'System.out.println("谢谢您的使用!");//fl
5、ag=false;System.exit(0);break;default:System.out.print("输入有误!请重新选择,输入数字:");break;}}while(flag);}...}2VerifyEqual.javapackagecn.itcast;importjava.util.Scanner;/***验证管理员登录**@authorAdministrator**/publicclassVerifyEqual{publicVerifyEqual(){}publicbooleanverify(Strings,Strings1){System
6、.out.print("请输入用户名:");Scannerscanner=newScanner(System.in);Strings2=scanner.next();System.out.print("请输入密码:");scanner=newScanner(System.in);Strings3=scanner.next();returns2.equals(s)&&s1.equals(s3);}}3CustManagement.javapackagecn.itcast;importjava.util.Scanner;publicclassCustManageme
7、nt{publicCustManagement(){}publicvoidsetData(Stringas[],doublead[],intai[],Stringas1[],intai1[]){goodsName=as;goodsPrice=ad;custNo=ai;custBirth=as1;...custScore=ai1;}publicvoidreturnLastMenu(){System.out.print("请按'n'返回上一级菜单:");Scannerscanner=newScanner(System.in);booleanflag=true
8、;doif(scanne
此文档下载收益归作者所有