太原理工大学软件java实验报告(19)
发布时间:2021-06-12
发布时间:2021-06-12
System.out.println("4 销售商品"); System.out.println("0 退出系统");
System.out.println("================="); int i = 0; do { try {
type = Integer.parseInt(readString()); i = 0; }
catch (Exception e) { i = 1;
System.err.println("输入有误"); } }
while (i != 0); switch (type) { case 1:
Goods goods = new Goods();
System.out.println("请输入商品名称"); goods.setName(readString()); do { try {
System.out.println("请输入商品价格");
goods.setPrice(Integer.parseInt(readString())); i = 0; }
catch (Exception e) { i = 1;
System.err.println("输入有误"); } }
while (i != 0); do {
上一篇:宜春一对一辅导机构哪家好