十二章

来源:互联网 发布:php代理程序 编辑:程序博客网 时间:2024/04/30 15:54
import java.util.*;public class shangchang {Scanner input = new Scanner(System.in);public void showLoginMenu() {do {System.out.println("\n\t欢迎使用我行我素购物管理系统\n");System.out.println("\t\t 1. 登 录 系 统\n");System.out.println("\t\t 2. 退 出\n");System.out.println("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");System.out.print("请选择,输入数字:");int n = input.nextInt();if (n == 1) {showMainMenu();} else if (n == 2) {break;} else {System.out.print("请重新输入");}} while (true);}public void showMainMenu() {do {System.out.println("\n\t我行我素购物管理系统主菜单\n");System.out.println("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");System.out.println("\t\t 1. 客 户 信 息 管 理\n");System.out.println("\t\t 2. 真 情 回 馈\n");System.out.println("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");System.out.print("请选择,输入数字或按0返回上一级菜单:");int n = input.nextInt();if (n == 1) {showCustMenu();} else if (n == 2) {showSendGMenu();} else if (n == 0) {System.out.println("返回上一层");break;} else {System.out.print("请重新输入");}} while (true);}public void showCustMenu() {do {System.out.println("\n\t我行我素购物管理系统 > 客户信息管理");System.out.println("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");System.out.println("\t\t  1. 显 示 所 有 客 户 信 息\n");System.out.println("\t\t  2. 添 加 客 户 信 息\n");System.out.println("\t\t  3. 修 改 客 户 信 息\n");System.out.println("\t\t  4. 查 询 客 户 信 息\n");System.out.println("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");System.out.print("请选择,输入数字或按0返回上一级菜单:");int n = input.nextInt();if (n == 1) {System.out.println("\t\t  1. 显 示 所 有 客 户 信 息\n");} else if (n == 2) {System.out.println("\t\t  2. 添 加 客 户 信 息\n");} else if (n == 3) {System.out.println("\t\t  3. 修 改 客 户 信 息\n");} else if (n == 4) {System.out.println("\t\t  4. 查 询 客 户 信 息\n");} else if (n == 0) {System.out.println("返回上一层");break;} else {System.out.print("请重新输入");}} while (true);}public void showSendGMenu() {do {System.out.println("\n\t我行我素购物管理系统 > 真情回馈");System.out.println("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");System.out.println("\t\t 1. 幸 运 大 放 送\n");System.out.println("\t\t 2. 幸 运 抽 奖\n");System.out.println("\t\t 3. 生 日 问 候\n");System.out.println("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");System.out.print("请选择,输入数字或按0返回上一级菜单:");int n = input.nextInt();if (n == 1) {System.out.println("\t\t 1. 幸 运 大 放 送\n");} else if (n == 2) {System.out.println("\t\t 2. 幸 运 抽 奖\n");} else if (n == 3) {System.out.println("\t\t 3. 生 日 问 候\n");} else if (n == 0) {System.out.println("返回上一层");break;} else {System.out.print("请重新输入");}} while (true);}public void showCustMMenu() {}}

0 0