【注】:由数组实现改为ArrayList实现。学生信息增加了年龄,性别。OOP。
【注】:由姓名查询并修改和删除 改为 由ID查询。
Day06_【学生管理系统】v1.0
Day09_【学生管理系统】v1.1
Day11_【学生管理系统】v2.0
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class StudentManager {
public static Scanner scanner = new Scanner(System.in);
static List<Student> stuList = new ArrayList<Student>();
public static int nextstudentID = 1;
public static void main(String[] args) {
display();
}
public static void display() {
System.out.println("***************************************");
System.out.println("**************学生管理系统**************");
System.out.println("***************************************");
while (true) {
System.out.println("1:教师登录\t2: 学生登录");
int chooseIdentity = scanner.nextInt();
if (chooseIdentity == 1) {
System.out.println("请输入你的账号:");
String username = scanner.next();
System.out.println("请输入你的密码:");
String password = scanner.next();
if (login(chooseIdentity, username, password)) {
teacherView();
return;
}
} else if (chooseIdentity == 2) {
System.out.println("请输入你的账号:");
String username = scanner.next();
System.out.println("请输入你的密码:");
String password = scanner.next();
if (login(chooseIdentity, username