zoukankan      html  css  js  c++  java
  • JavaSE:在线考试系统(3)

    1. 创建ClientView.java, 用于输出客户端的用户界面

     代码:

    package com.lagou.client;
    
    import java.util.Scanner;
    
    public class ClientView {
    
        // 自定义成员方法,实现客户端主界面的绘制
        public void clientMainPage() {
            while(true){
                System.out.println("  
    
    			   在线考试系统");
                System.out.println("-------------------------------------------");
                System.out.print("    [1] 学员系统");
                System.out.println("         [2] 管理员系统");
                System.out.println("    [0] 退出系统");
                System.out.println("-------------------------------------------");
                System.out.println("请选择要进行的业务编号:");
    
                Scanner sc = new Scanner(System.in);
                int choose = sc.nextInt();
                switch (choose){
                    case 1:
                        System.out.println("正在进入学员系统...");
                        break;
                    case 2:
                        System.out.println("正在进入管理员系统...");
                        break;
                    case 0:
                        System.out.println("正在退出系统...");
                        return;
                    default:
                        System.out.println("输入错误,请重新选择!");
                }
            }
        }
    }

    2. 在测试类ClientTest.java中,添加相应的测试代码:

    3. 运行效果:

  • 相关阅读:
    mybatis plus 执行sql
    springboot 打印 mybatisplus 的sql
    easyexcel 简单使用
    springboot ehcache
    easyexcel 时间转换
    springboot stopwatch
    c# 开机自动启动
    sqlHelper
    DirectX录音
    c# 发邮件
  • 原文地址:https://www.cnblogs.com/JasperZhao/p/14972535.html
Copyright © 2011-2022 走看看