📄 acstest.java
字号:
package com.accp.test;
import java.util.Scanner;
import com.accp.sys.ControlSys;
import com.accp.user.Admin;
import com.accp.user.Employee;
import com.accp.user.Guest;
public class AcsTest {
ControlSys cs = new ControlSys();
public void showMenu() {
Scanner sc = new Scanner(System.in);
String ans = "y";
while(ans.equalsIgnoreCase("y")) {
System.out.println("======门禁系统测试======");
System.out.println("= 1、访客测试 =");
System.out.println("= 2、顾员测试 =");
System.out.println("= 3、管理员测试 =");
System.out.println("=======================");
System.out.print("请选择菜单项:");
String choose = sc.next();
if(choose.equals("1")) {
testGuest();
} else if(choose.equals("2")) {
testEmployee();
} else if(choose.equals("3")) {
testAdmin();
} else {
System.out.println("选择错误!");
continue;
}
System.out.print("是否继续测试(y/n)?");
sc = new Scanner(System.in);
ans = sc.next();
}
}
public void testGuest() {
Guest guest = new Guest("小白");
guest.pressRing(cs);
Admin admin = new Admin("小黑");
admin.work(cs);
cs.work();
}
public void testEmployee() {
Employee emp = new Employee("晓晓");
emp.input(cs);
cs.work();
}
public void testAdmin() {
}
public static void main(String[] args) {
new AcsTest().showMenu();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -