2021-04-07 java上課內(nèi)容 購(gòu)物管理

```

ublic class tianxin3 {

? ? public static void main(String[] args) {

? ? ? ? System.out.println("********");

? ? ? ? System.out.println("\t\t 1登陸系統(tǒng)");

? ? ? ? System.out.println("\t\t 2退出");

? ? ? ? System.out.println("********");

? ? ? ? //用戶輸入功能號(hào)

? ? ? ? Scanner scanner = new Scanner(System.in);

? ? ? ? if ( scanner.hasNextInt() ){? //用戶需要輸入整數(shù),才會(huì)進(jìn)入判斷

? ? ? ? ? ? int bianhao1 = scanner.nextInt();

? ? ? ? ? ? if? ( bianhao1 == 1) {

? ? ? ? ? ? ? ? System.out.println("二級(jí)菜單");

? ? ? ? ? ? ? ? System.out.println("1 客戶信息管理");

? ? ? ? ? ? ? ? System.out.println("2 購(gòu)物結(jié)算");

? ? ? ? ? ? ? ? System.out.println("3 真情回饋");

? ? ? ? ? ? ? ? System.out.println("4 注銷");

? ? ? ? ? ? ? ? //進(jìn)入二級(jí)菜單

? ? ? ? ? ? ? ? System.out.println("輸入功能編號(hào)");

? ? ? ? ? ? ? ? int bianhao2 = scanner.nextInt();

? ? ? ? ? ? ? ? switch ( bianhao2) {

? ? ? ? ? ? ? ? ? ? case 1:

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("購(gòu)物管理系統(tǒng)>客戶信息化管理");

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("1 顯示所有客戶信息");

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("2 添加客戶信息");

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("3 修改客戶信息");

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("4 查詢客戶信息");

? ? ? ? ? ? ? ? ? ? ? ? // 具體客戶信息管理操作

? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ? ? case 2:

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("購(gòu)物結(jié)算");

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("輸入購(gòu)物金額");

? ? ? ? ? ? ? ? ? ? ? ? //用戶輸入 sumMoney

? ? ? ? ? ? ? ? ? ? ? ? double moeny = scanner.nextInt();

? ? ? ? ? ? ? ? ? ? ? ? double realmoney = 0;

? ? ? ? ? ? ? ? ? ? ? ? //顯示夠換信息

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("是否參加換購(gòu)活動(dòng)");

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("1 滿50 加2元換百事可樂(lè)");

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("2 滿100 加3元500ml可樂(lè)一瓶");

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("3 滿100 加10元5筋面粉");

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("4? 滿200 加10元炒菜鍋");

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("5 滿200 加10元爽膚水");

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("0 不換購(gòu)");

? ? ? ? ? ? ? ? ? ? ? ? // 用戶輸入功能編號(hào)

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("請(qǐng)選擇");

? ? ? ? ? ? ? ? ? ? ? ? int funNo = scanner.nextInt();

? ? ? ? ? ? ? ? ? ? ? ? switch ( funNo ) {

? ? ? ? ? ? ? ? ? ? ? ? ? ? case 1:

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if ( funNo >= 50) {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? realmoney = moeny+2;

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // System.out.println("本次消費(fèi)金額:"+( funNo + 2 ));

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("成功換購(gòu) 百事可樂(lè)一瓶");

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }else {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("你購(gòu)買的金額不足以參加本次換購(gòu)");

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ? ? ? ? ? ? case 2:

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if ( moeny >= 100) {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? realmoney = moeny + 3;

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //? System.out.println("本次消費(fèi)金額:"+(moeny + 3));

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("成功換購(gòu) 500ml可樂(lè)一瓶");

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ? ? ? ? ? ? case? 3:

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? realmoney = moeny+10;

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // System.out.println("本次消費(fèi)總金額"+(moeny+10));

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("成功換購(gòu) 5筋面粉");

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ? ? ? ? ? ? case 4:

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? realmoney = moeny + 10;

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //? System.out.println("本次消費(fèi)金額"+);

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("成功換購(gòu) 炒菜鍋");

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ? ? ? ? ? ? case? 5:

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? realmoney = moeny +20;

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // System.out.println("本次消費(fèi)金額"+ ( moeny+20));

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("成功換購(gòu) 爽膚水");

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ? ? ? ? ? ? case? 0:

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("本次消費(fèi)金額"+ moeny);

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("沒(méi)有參加換購(gòu)活動(dòng)");

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("本次換購(gòu)金額"+ moeny);

? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ? ? case 3:

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("購(gòu)物管理系統(tǒng)>真情回饋");

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("幸運(yùn)大放送");

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("新運(yùn)抽獎(jiǎng)");

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("生日問(wèn)候");

? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ? ? case 4:

? ? ? ? ? ? ? ? ? ? ? ? System.out.println("注銷");

? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? }

? ? ? ? ? ? }else? if(bianhao1 == 2) {

? ? ? ? ? ? ? ? System.out.println("你已退出系統(tǒng)");

? ? ? ? ? ? }

? ? ? ? }

? ? }

}

```

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容