日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > windows >内容正文

windows

javase 超市库存系统

發(fā)布時(shí)間:2025/7/25 windows 49 豆豆
生活随笔 收集整理的這篇文章主要介紹了 javase 超市库存系统 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
package com.oracle.demo01;import java.util.ArrayList; import java.util.Scanner;public class Demo01 {public static void main(String[] args) {System.out.println("=========================歡迎光臨 oracle 超市======================");System.out.println("1:貨物清單 2:添加新貨物 3:刪除貨物 4:修改貨物");System.out.println("5:退出系統(tǒng)");System.out.println("請您輸入要操作的功能序號(hào)"); System.out.println("--------------");while(true){System.out.println("1:貨物清單 2:添加新貨物 3:刪除貨物 4:修改貨物");System.out.println("5:退出系統(tǒng)");System.out.println("請您輸入要操作的功能序號(hào)");Scanner sc = new Scanner(System.in);int num = sc.nextInt();switch (num) {case 1:f1();break;case 2:f2();break;case 3:f3();break;case 4:f4();break;case 5:return;default:System.out.println("您輸入的有誤");break;}}}public static void f1() {ArrayList<chaoshi> arr = new ArrayList<chaoshi>();chaoshi c1 = new chaoshi();c1.spbh = 9001;c1.spm = "少林寺酥餅核桃";c1.jiage = 120.0;arr.add(c1);chaoshi c2 = new chaoshi();c2.spbh = 9002;c2.spm = "尚康雜糧牡丹餅";c2.jiage = 20.0;arr.add(c2);chaoshi c3 = new chaoshi();c3.spbh = 9003;c3.spm = "新疆原產(chǎn)哈密瓜";c3.jiage = 7.0;arr.add(c3);System.out.println("商品編號(hào)" + "\t" + "商品名稱" + "\t" + "\t" + "商品單價(jià)");for (int i = 0; i < arr.size(); i++) {System.out.println(arr.get(i).spbh + "\t" + arr.get(i).spm + "\t" + arr.get(i).jiage);}}public static void f2() {ArrayList<chaoshi> arr = new ArrayList<chaoshi>();chaoshi c4 = new chaoshi();System.out.println("輸入新水果的名稱:");Scanner mz = new Scanner(System.in);String sg = mz.next();c4.spm = sg;System.out.println("輸入新水果的編號(hào):");int sg1 = mz.nextInt();c4.spbh = sg1;System.out.println("輸入新水果的價(jià)格:");int sg2 = mz.nextInt();c4.jiage = sg2;arr.add(c4);chaoshi c1 = new chaoshi();c1.spbh = 9001;c1.spm = "少林寺酥餅核桃";c1.jiage = 120.0;arr.add(c1);chaoshi c2 = new chaoshi();c2.spbh = 9002;c2.spm = "尚康雜糧牡丹餅";c2.jiage = 20.0;arr.add(c2);chaoshi c3 = new chaoshi();c3.spbh = 9003;c3.spm = "新疆原產(chǎn)哈密瓜";c3.jiage = 7.0;arr.add(c3);System.out.println("商品編號(hào)" + "\t" + "商品名稱" + "\t" + "\t" + "商品單價(jià)");for (int i = 0; i < arr.size(); i++) {System.out.println(arr.get(i).spbh + "\t" + arr.get(i).spm + "\t" + arr.get(i).jiage);}}public static void f3() {System.out.println("輸入您要?jiǎng)h除的商品編號(hào)");Scanner sc = new Scanner(System.in);int sc1 = sc.nextInt();ArrayList<chaoshi> arr = new ArrayList<chaoshi>();chaoshi c1 = new chaoshi();c1.spbh = 9001;c1.spm = "少林寺酥餅核桃";c1.jiage = 120.0;arr.add(c1);chaoshi c2 = new chaoshi();c2.spbh = 9002;c2.spm = "尚康雜糧牡丹餅";c2.jiage = 20.0;arr.add(c2);chaoshi c3 = new chaoshi();c3.spbh = 9003;c3.spm = "新疆原產(chǎn)哈密瓜";c3.jiage = 7.0;arr.add(c3);if (sc1 == 9001) {arr.remove(0);}if (sc1 == 9002) {arr.remove(1);}if (sc1 == 9003) {arr.remove(2);}System.out.println("商品編號(hào)" + "\t" + "商品名稱" + "\t" + "\t" + "商品單價(jià)");for (int i = 0; i < arr.size(); i++) {System.out.println(arr.get(i).spbh + "\t" + arr.get(i).spm + "\t" + arr.get(i).jiage);}}public static void f4() {ArrayList<chaoshi> arr = new ArrayList<chaoshi>();chaoshi c1 = new chaoshi();c1.spbh = 9001;c1.spm = "少林寺酥餅核桃";c1.jiage = 120.0;arr.add(c1);chaoshi c2 = new chaoshi();c2.spbh = 9002;c2.spm = "尚康雜糧牡丹餅";c2.jiage = 20.0;arr.add(c2);chaoshi c3 = new chaoshi();c3.spbh = 9003;c3.spm = "新疆原產(chǎn)哈密瓜";c3.jiage = 7.0;arr.add(c3);System.out.println("輸入您要修改的商品編碼:");Scanner xg = new Scanner(System.in);int g1 = xg.nextInt();System.out.println("輸入新的商品編碼");int g2 = xg.nextInt();System.out.println("輸入新的水果名稱");String g3 = xg.next();System.out.println("輸入新的水果價(jià)格");int g4 = xg.nextInt();if (g1 == 9001) {c1.spbh = g2;c1.spm = g3;c1.jiage = g4;}if (g1 == 9002) {c2.spbh = g2;c2.spm = g3;c2.jiage = g4;}if (g1 == 9003) {c3.spbh = g2;c3.spm = g3;c3.jiage = g4;}System.out.println("商品編號(hào)" + "\t" + "商品名稱" + "\t" + "\t" + "商品單價(jià)");for (int i = 0; i < arr.size(); i++) {System.out.println(arr.get(i).spbh + "\t" + arr.get(i).spm + "\t" + arr.get(i).jiage);}} }

?

轉(zhuǎn)載于:https://www.cnblogs.com/hankai2735/p/9046903.html

總結(jié)

以上是生活随笔為你收集整理的javase 超市库存系统的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。