标签:
1 package base.no5; 2 3 import java.util.Scanner; 4 5 public class Keyichongfushuru { 6 public static void main(String[] args) { 7 System.out.println("欢迎使用MyShopping管理系统\n"); 8 System.out.println("*******************************************"); 9 System.out.println("1.客户信息管理"); 10 System.out.println("2.购物结算"); 11 System.out.println("3.真情回馈"); 12 System.out.println("4.注销"); 13 System.out.println("*******************************************"); 14 Scanner sc = new Scanner(System.in); 15 System.out.println("请选择,输入数字:"); 16 double num = sc.nextInt(); 17 int num1 = (int) num; 18 char ch =‘y‘; 19 do { 20 switch (num1) { 21 case 1: 22 System.out.println("执行客户信息管理"); 23 ch =‘n‘; 24 break; 25 case 2: 26 System.out.println("执行购物结算"); 27 ch =‘n‘; 28 break; 29 case 3: 30 System.out.println("执行真情回馈"); 31 ch =‘n‘; 32 break; 33 case 4: 34 System.out.println("程序结束"); 35 ch =‘n‘; 36 break; 37 default: 38 System.out.println("输入错误重新输入:"); 39 num1 = sc.nextInt(); 40 break; 41 } 42 } while (ch == ‘y‘); 43 } 44 }
标签:
原文地址:http://www.cnblogs.com/jintao/p/5255372.html