在teacherLogin()方法中添加查看问题页面的逻辑和数据库连接代码:

public static void teacherLogin() { Scanner scanner = new Scanner(System.in); System.out.println("请选择您要进行的操作:"); System.out.println("1. 查看问题"); System.out.println("2. 添加问题"); System.out.println("3. 删除问题"); System.out.println("4. 更新问题"); System.out.println("5. 返回主页面"); int choice = scanner.nextInt();

switch (choice) {
    case 1:
        viewQuestions(); // 调用查看问题页面的方法
        break;
    case 2:
        // 添加问题页面逻辑
        break;
    case 3:
        // 删除问题页面逻辑
        break;
    case 4:
        // 更新问题页面逻辑
        break;
    case 5:
        System.out.println("返回主页面");
        break;
    default:
        System.out.println("无效的选项!");
        break;
}

}

public static void viewQuestions() { Scanner scanner = new Scanner(System.in); System.out.println("请选择要查看的课程:"); System.out.println("1. Mathematics"); System.out.println("2. English"); System.out.println("3. Science"); int courseChoice = scanner.nextInt();

String courseName = "";
switch (courseChoice) {
    case 1:
        courseName = "Mathematics";
        break;
    case 2:
        courseName = "English";
        break;
    case
考试管理系统数据库设计与Java实现

原文地址: https://www.cveoy.top/t/topic/f0Ji 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录