展开全部
项目需求书不全,现在是只要62616964757a686964616fe58685e5aeb931333363373663一个首页功能么?已留好连接下级菜单的model方法,可扩展import java.util.Scanner;
public class MainUI {
Scanner sc;
private MainUI (Scanner sc){
this.sc = sc;
showUI();
int i = getChoice();
model(i);
}
private void model(int choice) {
switch (choice) {
case 1:
System.out.println("管理员登录OK");
break;
case 2:
System.out.println("医生登录OK");
break;
case 3:
System.out.println("患者登录OK");
break;
case 4:
System.out.println("退出系统");
sc.close();
System.exit(0);
break;
}
}
private int getChoice() {
String input;
int choice = 0;
while(!(input = sc.nextLine()).matches("[1234]")){
System.out.println("输入不对,请从新输入:");
}
choice = Integer.parseInt(input);
return choice;
}
private void showUI(){
System.out.println("欢迎您进入医院就诊管理系统系统");
System.out.println("\n");
System.out.println("**********登录菜单**********");
System.out.println("1、管理员登录");
System.out.println("2、医生登录");
System.out.println("3、患者登录");
System.out.println("4、退出系统");
System.out.println("请输入选项号");
System.out.println("*****************************");
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
new MainUI(scanner);
scanner.close();
}
}
这是一个使用Java编写的简单医院就诊管理系统,包含管理员、医生和患者登录功能。用户通过选择相应选项进行登录操作,系统会根据选择输出登录OK的提示。程序提供了一个首页功能,并预留了扩展到下级菜单的方法。
639

被折叠的 条评论
为什么被折叠?



