【实例简介】
【实例截图】
【核心代码】
package com.sec.shop;
import java.util.Scanner;
public class SystemMenu {
public void showMainMenu() {
//显示系统主菜单
System.out.println("\n* * * * * * * * * * * * * * * * * * * * * * * * * * * * *");
System.out.println("*\t\t\t\t\t\t\t\t *");
System.out.println("* 欢迎使用迷你青春购物系统\t\t *");
System.out.println("*\t\t\t\t\t\t\t\t *");
System.out.println("* * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
System.out.println("1.客户信息管理\n");
System.out.println("2.商品信息管理\n");
System.out.println("3.购物信息管理\n");
System.out.println("4.退出系统\n");
boolean flag;
do{
System.out.println("\n请选择功能(1-4):");
Scanner sc = new Scanner(System.in);
int fun = sc.nextInt();
flag = false;
switch(fun){
case 1:
showCustomerMenu();//显示客户管理菜单
break;
case 2:
showProductMenu();//显示商品管理菜单
break;
case 3:
buyProductMenu();//显示购物管理菜单
break;
case 4:
System.out.println("您已安全退出!欢迎下次使用本系统....");
System.exit(0);
break;
default:
System.out.println("请选择相应的功能,在1-4之间选择。");
flag = true;
}
}while(flag);
}