Java简易电影院系统

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;


            }
        }
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值