package edu.xcdq;
import java.util.Scanner;商品管理员
public class ArticleManage {
//创建一个商品集合(仓库)实例
ArticleSetarticleSet =new ArticleSet();
//对新建的仓库进行初始化
public void innitial() {
//创建商品
Article xiaomi11 =new Article();
xiaomi11.setArticle(mingzi:"小米11", kucun:50, danjia:2999, shouchu:1);
Article xiaomi11Pro =new Article();
xiaomi11Pro.setArticle(mingzi:"小米11专业版,kucun:30,danjia:3999,shouchu:2");
Article xiaomiUltra =new Article();
xiaomiUltra.setArticle(mingzi:"小米增强版", kucun:66, danjia:4999, shouchu:3);
//把商品放出到仓库中
articleSet.articles[0] = xiaomi11;
articleSet.articles[1] = xiaomi11Pro;
articleSet.articles[2] = xioamiUltra;
}
//起始菜单
public void startMenu() {
boolean flag =true;
do {
System.out.println("******************");
System.out.println("1查看商品信息");
System.out.println("新增商品信息");
System.out.println("3删除商品信息");
System.out.println("4卖出商品");
System.out.println("5商品销售排行榜");
System.out.println("6退出系统");
System.out.println("***************");
System.out.println("请输入你要执行的操作:");
Scanner scanner =new Scanner(System.in);
int gongnengbiaohao = scanner.nextInt();
switch (gongnengbiaohao) {
case 1:
System.out.println("查看商品信息");
break;
case 2:
System.out.println("新增商品信息");
break;
case 3:
System.out.println("删除商品信息");
break;
case 4:
System.out.println("卖出商品");
break;
case 5:
System.out.println("排行榜");
break;
case 6:
System.out.println("退出系统");
flag =false;
break;
default:
System.out.println("你输入的功能编号有误");
break;
}
}while (flag);
}
//查看商品信息
public void chakan() {
System.out.println("编号:\t名称\t库存\t价格\t售出数量");
for (int i =0; i
if (articleSet.articles[i] !=null) {
articleSet.article[i].print(i);
}
}
}
//添加商品
public void add() {
}
}