java购物系统源代码_第1页
java购物系统源代码_第2页
java购物系统源代码_第3页
java购物系统源代码_第4页
java购物系统源代码_第5页
已阅读5页,还剩15页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1 StartSMS.javapackage cn.itcast;import java.util.Scanner;/* * 系统开启类 * * author Administrator * */public class StartSMS public StartSMS() public static void main(String args) Data data = new Data();data.ini();Menu menu = new Menu();menu.setData(data.goodsName, data.goodsPrice, data.custNo,data.custB

2、irth, data.custScore);menu.showLoginMenu();boolean flag = true;label0: do if (!flag)break;Scanner scanner = new Scanner(System.in);int i = scanner.nextInt();VerifyEqual verifyequal = new VerifyEqual();switch (i) case 1: / 001int j = 3;do if (j 客户信息管理 添加客户信息nn);Scanner scanner = new Scanner(System.in

3、);System.out.print(请输入会员号():);int i = scanner.nextInt();System.out.print(请输入会员生日(月/日):);String s = scanner.next();System.out.print(请输入积分:);int j = scanner.nextInt();int k = -1;int l = 0;do if (l = custNo.length)break;if (custNol = 0) k = l;break;l+; while (true);custNok = i;custBirthk = s;custScorek

4、 = j;System.out.println(新会员添加成功!);returnLastMenu();public void modify() System.out.println(购物管理系统 客户信息管理 修改客户信息nn);System.out.print(请输入会员号:);Scanner scanner = new Scanner(System.in);int i = scanner.nextInt();System.out.println( 会员号 生日 积分 );System.out.println(-|-|-);int j = -1;int k = 0;do if (k = cu

5、stNo.length)break;if (custNok = i) System.out.println(new StringBuilder().append(custNok).append(tt).append(custBirthk).append(tt).append(custScorek).toString();j = k;break;k+; while (true);if (j != -1) System.out.println(* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

6、*n);System.out.println(tttt1.修 改 会 员 生 日.n);System.out.println(tttt2.修 改 会 员 积 分.n);System.out.println(* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.print(请选择,输入数字:);switch (scanner.nextInt() case 1: / 001System.out.print(请输入修改后的生日:);custBirthj = scanne

7、r.next();System.out.println(生日信息已更改!);break;case 2: / 002System.out.print(请输入修改后的会员积分:);custScorej = scanner.nextInt();System.out.println(会员积分已更改!);break; else System.out.println(抱歉,没有你查询的会员。);returnLastMenu();public void search() System.out.println(购物管理系统 客户信息管理 查询客户信息n);String s = y;Scanner scanne

8、r = new Scanner(System.in);for (; s.equals(y); s = scanner.next() System.out.print(请输入会员号:);int i = scanner.nextInt();System.out.println( 会员号 生日 积分 );System.out.println(-|-|-);boolean flag = false;int j = 0;do if (j = custNo.length)break;if (custNoj = i) System.out.println(new StringBuilder().append

9、(custNoj).append(tt).append(custBirthj).append(tt).append(custScorej).toString();flag = true;break;j+; while (true);if (!flag)System.out.println(抱歉,没有你查询的会员信息。);System.out.print(n要继续查询吗(y/n):);returnLastMenu();public void show() System.out.println(购物管理系统 客户信息管理 显示客户信息nn);System.out.println( 会员号 生日 积

10、分 );System.out.println(-|-|-);int i = custNo.length;for (int j = 0; j 生日问候nn);System.out.print(请输入今天的日期(月/日):);Scanner scanner = new Scanner(System.in);String s = scanner.next();System.out.println(s);String s1 = ;boolean flag = false;for (int i = 0; i 幸运抽奖nn);System.out.print(是否开始(y/n):);Scanner sca

11、nner = new Scanner(System.in);if (scanner.next().equals(y) int i = (int) (Math.random() * 10D);boolean flag = false;String s = ;for (int k = 0; k 幸运大放送nn);int i = 0;int j = custScore0;for (int k = 0; k j) j = custScorek;i = k;System.out.println(new StringBuilder().append(具有最高积分的会员是: ).append(custNoi

12、).append(t).append(custBirthi).append(t).append(custScorei).toString();Gift gift = new Gift(); = 苹果笔记本电脑;gift.price = 12000D;System.out.print(恭喜!获赠礼品: );System.out.println(gift);returnLastMenu();public String goodsName;public double goodsPrice;public int custNo;public String custBirth;publi

13、c int custScore;7 Manager.javapackage cn.itcast;/* * 管理员类 * * author Administrator * */public class Manager public Manager() username = itcast;password = itcast;public String username;public String password;8 Menu.javapackage cn.itcast;import java.util.Scanner;/* * 页面类 * * author Administrator * */p

14、ublic class Menu public Menu() public void setData(String as, double ad, int ai, String as1,int ai1) goodsName = as;goodsPrice = ad;custNo = ai;custBirth = as1;custScore = ai1;public void showLoginMenu() System.out.println(nnttt 欢迎使用itcast购物管理系统1.0版nn);System.out.println(* * * * * * * * * * * * * *

15、* * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.println(tttt 1. 登 录 系 统nn);System.out.println(tttt 2. 更 改 管 理 员 密 码nn);System.out.println(tttt 3. 退 出nn);System.out.println(* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.print(请选择,输入数字:);p

16、ublic void showMainMenu() System.out.println(nntttt欢迎使用购物管理系统n);System.out.println(* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.println(tttt 1. 客 户 信 息 管 理n);System.out.println(tttt 2. 购 物 结 算n);System.out.println(tttt 3. 真 情 回 馈n);System.out.println(t

17、ttt 4. 注 销n);System.out.println(* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.print(请选择,输入数字:);Scanner scanner = new Scanner(System.in);boolean flag = false;do String s = scanner.next();if (s.equals(1) showCustMMenu();break;if (s.equals(2) Pay pay = new

18、 Pay();pay.setData(goodsName, goodsPrice, custNo, custBirth,custScore);pay.calcPrice();break;if (s.equals(3) showSendGMenu();break;if (s.equals(4) showLoginMenu();break;System.out.print(输入错误,请重新输入数字:);flag = false; while (!flag);public void showCustMMenu() System.out.println(购物管理系统 客户信息管理n);System.o

19、ut.println(* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.println(tttt 1. 显 示 所 有 客 户 信 息n);System.out.println(tttt 2. 添 加 客 户 信 息n);System.out.println(tttt 3. 修 改 客 户 信 息n);System.out.println(tttt 4. 查 询 客 户 信 息n);System.out.println(* * * * * * * * * *

20、* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.print(请选择,输入数字或按n返回上一级菜单:);Scanner scanner = new Scanner(System.in);boolean flag = true;do CustManagement custmanagement = new CustManagement();custmanagement.setData(goodsName, goodsPrice, custNo, custBirth,custScore);String s

21、 = scanner.next();if (s.equals(1) custmanagement.show();break;if (s.equals(2) custmanagement.add();break;if (s.equals(3) custmanagement.modify();break;if (s.equals(4) custmanagement.search();break;if (s.equals(n) showMainMenu();break;System.out.println(输入错误, 请重新输入数字:);flag = false; while (!flag);pub

22、lic void showSendGMenu() System.out.println(购物管理系统 真情回馈n);System.out.println(* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.println(tttt 1. 幸 运 大 放 送n);System.out.println(tttt 2. 幸 运 抽 奖n);System.out.println(tttt 3. 生 日 问 候n);System.out.println(* * * * *

23、 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.print(请选择,输入数字或按n返回上一级菜单:);Scanner scanner = new Scanner(System.in);boolean flag = true;GiftManagement giftmanagement = new GiftManagement();giftmanagement.setData(goodsName, goodsPrice, custNo, custBirth,custScore);

24、do String s = scanner.next();if (s.equals(1) giftmanagement.sendGoldenCust();break;if (s.equals(2) giftmanagement.sendLuckyCust();break;if (s.equals(3) giftmanagement.sendBirthCust();break;if (s.equals(n) showMainMenu();break;System.out.println(输入错误, 请重新输入数字:);flag = false; while (!flag);public Stri

25、ng goodsName;public double goodsPrice;public int custNo;public String custBirth;public int custScore;9 Pay.javapackage cn.itcast;import java.util.Scanner;/* * 购物付款 * * author Administrator * */public class Pay public Pay() public void setData(String as, double ad, int ai, String as1,int ai1) goodsName = as;goodsPrice = ad;custNo = ai;custBirth = as1;custScore = ai1;public double getDiscount(int i, int ai, int ai1) int j = -1;int k = 0;do if (k = ai.length)break;if (i = aik) j = k;break;k+; whi

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论