public class cima { public static void main(String[] args) { String usertname = "ADMIN"; String password = "ADMIN"; for (int i = 0; i < 3; i++) { Scanner sc = new Scanner(System.in); System.out.println("请输入用户名"); String Username = sc.next(); System.out.println("请输入密码"); String Password = sc.next(); if (usertname.equals(Username) && Password.equals(password)) { System.out.println("用户登录成功"); break; } else { System.out.println("用户登录失败"); } } String see[] = new String[10]; String boo[] = new String[10]; String doo[] = new String[10]; Scanner inoiy = new Scanner(System.in); boolean f = true; System.out.println("1.查询"); System.out.println("2.下架"); System.out.println("3.上架"); System.out.println("4.退出"); System.out.println("请输入你的操作"); int c = inoiy.nextInt(); switch (c) { case 1: System.out.println("===========查询界面================"); System.out.println("编号\t\t序号\t\t名称\t\t状态\t\t"); for (int i = 0; i < see.length; i++) { if (see[i] == null) { break; } System.out.println((i + 1) + "\t\t" + see[i] + "\t\t" + boo[i] + "\t\t" + doo[i] + "\t\t"); } break; case 2: System.out.println("=========影名状态=============="); System.out.println("请输入需要下架的编号:"); String see1 = inoiy.next(); boolean s2 = true; for (int i = 0; i < see.length; i++) { if (see1.equals(see[i])) { s2 = false; System.out.println("下架电影吗?"); doo[i] = inoiy.next(); System.out.println("下架成功"); break; } } break; case 3: System.out.println("=========电影名状态=============="); System.out.println("请输入电影名编号:"); String soo1 = inoiy.next(); System.out.println("请输入电影名:"); String bee1 = inoiy.next(); System.out.println("请输入电影名状态:"); String dee1 = inoiy.next(); boolean s11 = true; for (int i = 0; i < see.length; i++) { if (see[i] == null) {//找空位 s11 = false; see[i] = soo1; boo[i] = bee1; doo[i] = dee1; System.out.println("上架成功"); break; } } break; case 4: System.out.println("感谢使用,再见"); f = false; break; } }
Java简易电影院系统
最新推荐文章于 2022-12-02 16:22:32 发布