学生管理系统(残缺版)

package Project;

import java.util.Scanner;

public class OnlineTe {
    public static void main(String[] args) {
        for (;;){
        System.out.println("------欢迎使用OnlineT------");
        System.out.println("请输入访问的级别:");
        System.out.println("1:Stu");
        System.out.println("2:Manageer");
        System.out.println("3:Quit");
        Scanner sc =new Scanner(System.in);
        int num = sc.nextInt();
        String sna="1";
        String spw="123456";
        String mna="2";
        String mpw="123456";
        String [] Namebox =new String[10];
        String [] Pssswordbox =new String[10];
        int flag = 0;
        //StuSystem
        if (num==1){
            a:for (;;){
                System.out.println("您的身份是Stu,请(1.登录) 或( 2.创建!)");
                int chose1= sc.nextInt();
                if (chose1==1){//登录
                    for (;;){
                        for (;;){
                            for (;flag!=1;){
                            System.out.println("Name:");
                            String stuName = sc.next();
                            System.out.println("Password:");
                            String stupw = sc.next();
                            for (int i = 0; i < 10; i++) {
                                if (stuName.equals(sna)|stuName.equals(Namebox[i])){//对比用户名
                                    System.out.println("Name Right !");
                                    if (stupw.equals(spw)|stupw.equals(Pssswordbox[i])){//对比密码
                                        System.out.println("Password Right ! Login success!");//进入系统
                                        flag=1;
                                        System.out.println("Welcome to StuSystem ! Please choise your block ! ( 1.User Block )( 2.Text Block)( 3. Quit )");
                                        int chose2= sc.nextInt();
                                        if (chose2==1){//用户管理
                                            System.out.println("Please choise your Action ! ( 1.Change Password )( 2. Quit )");
                                            int chose3= sc.nextInt();
                                            if (chose3==1){
                                                System.out.println("--修改密码界面--");
                                            } else if (chose3==2) {
                                                System.out.println("Do you wanna to Qqqquit?");
                                                break;
                                            }

                                        } else if (chose2==2) {//考试管理
                                            System.out.println("Exam begins!");
                                            System.out.println("Exam over! waht do you annna do ? (1.Query grades )(2.Output grades )(3.Quit )");
                                            int chose4= sc.nextInt();
                                            if (chose4==1){//查询
                                                System.out.println("Your grade is **** !");
                                            } else if (chose4==2) {//导出
                                                System.out.println("Output success !");
                                            }else {//退出
                                                System.out.println("Do you wanna to Quit ?");
                                                break;
                                            }

                                        }else if (chose2==3){
                                            System.out.println(" you wanna to Quit ?");
                                            break a;
                                        }
                                    }else {
                                        System.out.println("Password worng ! Try again!");//再次尝试
                                    }
                                }else if (flag!=1){
                                    System.out.println("Not Right ! Try again ! ");
                                    break a;
                                }
                            }
                        }
                      }
                    }
                }
                if (chose1==2){//注册
                    b:for (;;){
                        System.out.println("Please input Name:");
                        String name1 = sc.next();
                        boolean found = false;
                        for (int i = 0; i < Namebox.length; i++) {
                            if (Namebox[i] == null) {
                                Namebox[i] = name1;
                                System.out.println("成功注册Name!");
                                found = true;
                                break;
                            } else if (Namebox[i].equals(name1)) {
                                System.out.println("Name already used!");
                                found = true;
                                break b;
                            }
                        }
                        if (!found){
                            System.out.println("所有用户名位置已满!");
                        }else {
                            System.out.println("Please input Password:");
                            String password1 = sc.next();
                            for (int n = 0; n < Pssswordbox.length; n++){
                                if (Pssswordbox[n] == null) {
                                    Pssswordbox[n] = password1;
                                    System.out.println("成功注册Password!");
                                    System.out.println("注册成功!");
                                    break b;
                                }
                            }
                        }
                    }//
              }
            }
        }
        if (num==2){
            for (;;){
            System.out.println("欢迎登陆管理员!");
            System.out.println("Name:");
            String name = sc.next();
            if (name.equals(mna)){
                System.out.println("Name Right !");
                System.out.println("Password:");
                String password = sc.next();
                if (password.equals(mpw)){
                    System.out.println("Password Right !");
                    System.out.println("管理员登陆成功!");
                    for (;;){
                    System.out.println("Waht do you annna do ? (1.管理学员 )(2.管理考题 )(3.Quit )");
                    int choise5 = sc.nextInt();
                    if (choise5==1){
                        for (;;){
                        System.out.println("---学员管理界面---");
                        System.out.println("Waht do you annna do ? (1.增加学员)(2.删除学员)(3.修改学员)(4.查找学员)(5.显示所有学员信息)(6.退出本模块)");
                        int choise6 = sc.nextInt();
                        if (choise6==1){
                            System.out.println("增加学员");
                        } else if (choise6==2) {
                            System.out.println("删除学员");
                        } else if (choise6==3) {
                            System.out.println("修改学员");
                        } else if (choise6==4) {
                            System.out.println("查找学员");
                        } else if (choise6==5) {
                            System.out.println("显示所有学员信息");
                        } else if (choise6==6) {
                            System.out.println("退出本模块");
                            break;
                        }
                    }
                    if (choise5==2){
                        System.out.println("---考题管理界面---");
                        System.out.println("Waht do you annna do ? (1.增加考题)(2.删除考题)(3.修改考题)(4.查找考题)(5.显示所有考题信息)(6.退出本模块)");
                        int choise7 = sc.nextInt();
                        if (choise7==1){
                            System.out.println("增加考题");
                        } else if (choise7==2) {
                            System.out.println("删除考题");
                        } else if (choise7==3) {
                            System.out.println("修改考题");
                        } else if (choise7==4) {
                            System.out.println("查找考题");
                        } else if (choise7==5) {
                            System.out.println("显示所有考题信息");
                        } else if (choise7==6) {
                            System.out.println("退出本模块");
                            break;
                        }
                    }
                    if (choise5==3){
                        System.out.println("退出至起始模块");
                        break ;
                      }
                    }
                }
                if (!password.equals(mpw)){
                    System.out.println("Not Right ! Try again ! ");
                    break;
                   }
                }
            }
            if (!name.equals(mna)){
                System.out.println("Not Right ! Try again ! ");
                break;
               }
            }
       }
    }
  }
}

相关推荐

  1. 学生管理系统残缺

    2024-07-12 15:40:01       22 阅读
  2. 学生管理系统本地化存储

    2024-07-12 15:40:01       41 阅读
  3. day12笔记(学生管理系统升级)

    2024-07-12 15:40:01       45 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-12 15:40:01       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-12 15:40:01       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-12 15:40:01       58 阅读
  4. Python语言-面向对象

    2024-07-12 15:40:01       69 阅读

热门阅读

  1. IPython多核并行编程指南:并发任务处理

    2024-07-12 15:40:01       22 阅读
  2. 【LeetCode】快乐数

    2024-07-12 15:40:01       21 阅读
  3. 数据分析如何正确地学习与使用

    2024-07-12 15:40:01       21 阅读
  4. MySQL 常用功能

    2024-07-12 15:40:01       25 阅读
  5. keep-alive缓存组件

    2024-07-12 15:40:01       19 阅读
  6. 【小迪安全笔记V2022】基础入门4~5

    2024-07-12 15:40:01       21 阅读
  7. 深入解析HTTP与HTTPS协议及其应用

    2024-07-12 15:40:01       23 阅读
  8. 【小迪安全笔记V2022】基础入门1~3

    2024-07-12 15:40:01       27 阅读
  9. generalized Bender’s decomposition

    2024-07-12 15:40:01       19 阅读