




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、1 StartSMS.javapackage cn.itcast;import java.util.Scanner;/* * 系統(tǒng)開啟類 * * 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(購物管理系統(tǒng) 客戶信息管理 修改客戶信息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(請選擇,輸入數(shù)字:);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(購物管理系統(tǒng) 客戶信息管理 查詢客戶信息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要繼續(xù)查詢嗎(y/n):);returnLastMenu();public void show() System.out.println(購物管理系統(tǒng) 客戶信息管理 顯示客戶信息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 幸運(yùn)抽獎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 幸運(yùn)大放送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購物管理系統(tǒng)1.0版nn);System.out.println(* * * * * * * * * * * * * *
15、* * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.println(tttt 1. 登 錄 系 統(tǒng)nn);System.out.println(tttt 2. 更 改 管 理 員 密 碼nn);System.out.println(tttt 3. 退 出nn);System.out.println(* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.print(請選擇,輸入數(shù)字:);p
16、ublic void showMainMenu() System.out.println(nntttt歡迎使用購物管理系統(tǒng)n);System.out.println(* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.println(tttt 1. 客 戶 信 息 管 理n);System.out.println(tttt 2. 購 物 結(jié) 算n);System.out.println(tttt 3. 真 情 回 饋n);System.out.println(t
17、ttt 4. 注 銷n);System.out.println(* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.print(請選擇,輸入數(shù)字:);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(輸入錯誤,請重新輸入數(shù)字:);flag = false; while (!flag);public void showCustMMenu() System.out.println(購物管理系統(tǒng) 客戶信息管理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(請選擇,輸入數(shù)字或按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(輸入錯誤, 請重新輸入數(shù)字:);flag = false; while (!flag);pub
22、lic void showSendGMenu() System.out.println(購物管理系統(tǒng) 真情回饋n);System.out.println(* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.println(tttt 1. 幸 運(yùn) 大 放 送n);System.out.println(tttt 2. 幸 運(yùn) 抽 獎n);System.out.println(tttt 3. 生 日 問 候n);System.out.println(* * * * *
23、 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *n);System.out.print(請選擇,輸入數(shù)字或按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(輸入錯誤, 請重新輸入數(shù)字:);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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 幼兒園港口文化活動方案
- 廣告公司商務(wù)活動方案
- 店鋪送飲料活動方案
- 康樂運(yùn)動活動方案
- 幼兒園教育文化活動方案
- 建設(shè)分公司成立策劃方案
- 幼兒藏族活動方案
- 幼兒大器械活動方案
- 建黨節(jié)活動母嬰活動方案
- 幼兒園三八親子活動方案
- 安全生產(chǎn)檢查咨詢服務(wù)投標(biāo)方案(技術(shù)方案)
- 河南省新鄭市2024-2025學(xué)年九年級下學(xué)期第二次聯(lián)考數(shù)學(xué)試題試卷
- 2025綠色建筑檢驗(yàn)機(jī)構(gòu)能力驗(yàn)證要求
- 全省工會系統(tǒng)經(jīng)審業(yè)務(wù)技能大賽含答案
- 刻蝕工藝考試題及答案
- 工程利潤分紅協(xié)議書
- 2025年上海市安全員C3證(專職安全員-綜合類)考試題庫
- 基本公共衛(wèi)生服務(wù)2025版培訓(xùn)
- 語言智能技術(shù)的未來應(yīng)用
- 智慧養(yǎng)老商業(yè)模式設(shè)計
- 2025年糧油保管員職業(yè)技能資格知識考試題(附答案)
評論
0/150
提交評論