//21.3.29
String answer ="y";
String userName="";//用户名
String password ="";//密码
int cardNumber=0 ;//卡号
boolean isRegister =false ;
int max =9999;
int min =1000;
Scanner input =new Scanner(System.in);
do {
System.out.println("*****欢迎进入奖客富翁系统*****");
System.out.println("/t1.注册");
System.out.println("/t2.登录");
System.out.println("/t3.抽奖");
System.out.println("***************************");
System.out.print("请选择菜单");
int choice = input.nextInt();
switch (choice){
case 1:
System.out.println("[奖客富翁系统]>注册");
System.out.println("请填写个人注册信息");
System.out.println("用户名");
userName =input.next();
System.out.println("密码");
password = input.next();
//随机获取四位数字作为卡号
cardNumber = (int) (Math.random()*(max - min))+min;
System.out.println("\n注册成功,请记住您的会员卡号");
System.out.println("用户名\t密码\t会员卡号" );
System.out.println(userName+"\t"+password+"\t"+cardNumber );
isRegister =true;//注册成功,标志设置为true
case 2:
System.out.println("[奖客富翁系统>登录]");
break;
case 3:
System.out.println("[奖客富翁系统>抽奖]");
break;
default:
System.out.println("[您输入的有误!]");
break;
}
System.out.print("继续吗 ?(y/n):");
answer = input.next();
System.out.println("");
}while ("y".equals(answer));
if ("n".equals(answer)){
System.out.println("系统退出,谢谢使用!");
}