欢迎来到天天文库
浏览记录
ID:49974369
大小:43.01 KB
页数:20页
时间:2020-03-03
《java购物系统源代码.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
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.
2、custBirth,data.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.
3、manager.username,data.manager.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.p
4、assword)){System.out.print("请输入新的用户名:");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;case
5、3://' 03'System.out.println("谢谢您的使用!");//flag=false;System.exit(0);break;default:System.out.print("输入有误!请重新选择,输入数字:");break;}}while(flag);}}2VerifyEqual.javapackagecn.itcast;importjava.util.Scanner;/***验证管理员登录**@authorAdministrator**/publicclassVerifyEqual{publicVerify
6、Equal(){}publicbooleanverify(Strings,Strings1){System.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.jav
7、apackagecn.itcast;importjava.util.Scanner;publicclassCustManagement{publicCustManagement(){}publicvoidsetData(Stringas[],doublead[],intai[],Stringas1[],intai1[]){goodsName=as;goodsPrice=ad;custNo=ai;custBirth=as1;custScore=ai1;}publicvoidreturnLastMenu(){System.out.print(
8、"请按'n'返回上一级菜单:");Scannerscanner=newScanner(System.in);booleanflag=true;doif(scanner.next().e
此文档下载收益归作者所有