设计一个简单的学校人事管理系统,管理教师和学生信息。实现教师与学生基本信息的添加、删除、修改、查询。其中编号、姓名、性别、出生日期为共有的,教师包括部门、职称、工资;学生包括高考分数、专业field、班级等。
时间: 2023-11-08 09:40:24 浏览: 224
好的,我可以为您设计一个简单的学校人事管理系统。以下是系统的设计方案:
1. 数据库设计:创建两个表,一个是教师表,一个是学生表。
教师表包括字段:编号、姓名、性别、出生日期、部门、职称、工资。
学生表包括字段:编号、姓名、性别、出生日期、高考分数、专业field、班级。
2. 实现基本功能:
添加:用户输入信息后,将信息插入到相应表中。
删除:用户输入编号后,从相应表中删除对应的记录。
修改:用户输入编号以及需要修改的信息,将相应表中的记录进行修改。
查询:提供多种查询方式,如按编号查询、按姓名查询等。用户输入相应的查询条件,系统将查询结果返回。
3. 界面设计:
系统主界面包括教师管理和学生管理两个选项,用户选择相应选项后进入相应界面。
教师管理界面包括添加、删除、修改、查询四个操作选项。
学生管理界面包括添加、删除、修改、查询四个操作选项。
4. 编码实现:
使用Java语言编写程序,使用JDBC连接数据库进行数据的增删改查操作。使用Swing框架设计界面,实现用户交互。
以上就是一个简单的学校人事管理系统的设计方案。希望可以帮助到您。
相关问题
设计一个简单的学校人事管理系统,管理教师和学生信息。实现教师与学生基本信息的添加、删除、修改、查询。其中编号、姓名、性别、出生日期为共有的,教师包括部门、职称、工资;学生包括高考分数、专业field、
班级信息。系统应该具有用户登录、权限管理、数据备份等功能。可以使用数据库来存储数据,也可以使用文件来存储数据。系统应该具有友好的用户界面,方便用户使用。同时,系统应该具有一定的安全性,保护用户的隐私信息。
用JAVA设计一个简单的学校人事管理系统,管理教师和学生信息。实现教师与学生基本信息的添加、删除、修改、查询。其中编号、姓名、性别、出生日期为共有的,教师包括部门、职称、工资;学生包括高考分数、专业field、
班级。以下是一个简单的学校人事管理系统的JAVA代码实现:
```
import java.util.ArrayList;
import java.util.Scanner;
public class SchoolManagementSystem {
public static void main(String[] args) {
ArrayList<Teacher> teacherList = new ArrayList<>();
ArrayList<Student> studentList = new ArrayList<>();
Scanner scanner = new Scanner(System.in);
while (true) {
System.out.println("请选择操作:");
System.out.println("1. 添加教师信息");
System.out.println("2. 删除教师信息");
System.out.println("3. 修改教师信息");
System.out.println("4. 查询教师信息");
System.out.println("5. 添加学生信息");
System.out.println("6. 删除学生信息");
System.out.println("7. 修改学生信息");
System.out.println("8. 查询学生信息");
System.out.println("9. 退出程序");
int choice = scanner.nextInt();
switch (choice) {
case 1:
addTeacher(teacherList, scanner);
break;
case 2:
deleteTeacher(teacherList, scanner);
break;
case 3:
modifyTeacher(teacherList, scanner);
break;
case 4:
queryTeacher(teacherList, scanner);
break;
case 5:
addStudent(studentList, scanner);
break;
case 6:
deleteStudent(studentList, scanner);
break;
case 7:
modifyStudent(studentList, scanner);
break;
case 8:
queryStudent(studentList, scanner);
break;
case 9:
System.out.println("程序已退出!");
System.exit(0);
break;
default:
System.out.println("输入错误,请重新输入!");
break;
}
}
}
private static void addTeacher(ArrayList<Teacher> teacherList, Scanner scanner) {
System.out.println("请输入教师编号:");
int id = scanner.nextInt();
System.out.println("请输入教师姓名:");
String name = scanner.next();
System.out.println("请输入教师性别:");
String gender = scanner.next();
System.out.println("请输入教师出生日期:");
String birthday = scanner.next();
System.out.println("请输入教师部门:");
String department = scanner.next();
System.out.println("请输入教师职称:");
String title = scanner.next();
System.out.println("请输入教师工资:");
double salary = scanner.nextDouble();
Teacher teacher = new Teacher(id, name, gender, birthday, department, title, salary);
teacherList.add(teacher);
System.out.println("教师信息已添加!");
}
private static void deleteTeacher(ArrayList<Teacher> teacherList, Scanner scanner) {
System.out.println("请输入要删除的教师编号:");
int id = scanner.nextInt();
for (Teacher teacher : teacherList) {
if (teacher.getId() == id) {
teacherList.remove(teacher);
System.out.println("教师信息已删除!");
return;
}
}
System.out.println("未找到该教师!");
}
private static void modifyTeacher(ArrayList<Teacher> teacherList, Scanner scanner) {
System.out.println("请输入要修改的教师编号:");
int id = scanner.nextInt();
for (Teacher teacher : teacherList) {
if (teacher.getId() == id) {
System.out.println("请输入新的教师姓名:");
String name = scanner.next();
System.out.println("请输入新的教师性别:");
String gender = scanner.next();
System.out.println("请输入新的教师出生日期:");
String birthday = scanner.next();
System.out.println("请输入新的教师部门:");
String department = scanner.next();
System.out.println("请输入新的教师职称:");
String title = scanner.next();
System.out.println("请输入新的教师工资:");
double salary = scanner.nextDouble();
teacher.setName(name);
teacher.setGender(gender);
teacher.setBirthday(birthday);
teacher.setDepartment(department);
teacher.setTitle(title);
teacher.setSalary(salary);
System.out.println("教师信息已修改!");
return;
}
}
System.out.println("未找到该教师!");
}
private static void queryTeacher(ArrayList<Teacher> teacherList, Scanner scanner) {
System.out.println("请输入要查询的教师编号:");
int id = scanner.nextInt();
for (Teacher teacher : teacherList) {
if (teacher.getId() == id) {
System.out.println(teacher.toString());
return;
}
}
System.out.println("未找到该教师!");
}
private static void addStudent(ArrayList<Student> studentList, Scanner scanner) {
System.out.println("请输入学生编号:");
int id = scanner.nextInt();
System.out.println("请输入学生姓名:");
String name = scanner.next();
System.out.println("请输入学生性别:");
String gender = scanner.next();
System.out.println("请输入学生出生日期:");
String birthday = scanner.next();
System.out.println("请输入学生高考分数:");
double score = scanner.nextDouble();
System.out.println("请输入学生专业:");
String field = scanner.next();
System.out.println("请输入学生班级:");
String className = scanner.next();
Student student = new Student(id, name, gender, birthday, score, field, className);
studentList.add(student);
System.out.println("学生信息已添加!");
}
private static void deleteStudent(ArrayList<Student> studentList, Scanner scanner) {
System.out.println("请输入要删除的学生编号:");
int id = scanner.nextInt();
for (Student student : studentList) {
if (student.getId() == id) {
studentList.remove(student);
System.out.println("学生信息已删除!");
return;
}
}
System.out.println("未找到该学生!");
}
private static void modifyStudent(ArrayList<Student> studentList, Scanner scanner) {
System.out.println("请输入要修改的学生编号:");
int id = scanner.nextInt();
for (Student student : studentList) {
if (student.getId() == id) {
System.out.println("请输入新的学生姓名:");
String name = scanner.next();
System.out.println("请输入新的学生性别:");
String gender = scanner.next();
System.out.println("请输入新的学生出生日期:");
String birthday = scanner.next();
System.out.println("请输入新的学生高考分数:");
double score = scanner.nextDouble();
System.out.println("请输入新的学生专业:");
String field = scanner.next();
System.out.println("请输入新的学生班级:");
String className = scanner.next();
student.setName(name);
student.setGender(gender);
student.setBirthday(birthday);
student.setScore(score);
student.setField(field);
student.setClassName(className);
System.out.println("学生信息已修改!");
return;
}
}
System.out.println("未找到该学生!");
}
private static void queryStudent(ArrayList<Student> studentList, Scanner scanner) {
System.out.println("请输入要查询的学生编号:");
int id = scanner.nextInt();
for (Student student : studentList) {
if (student.getId() == id) {
System.out.println(student.toString());
return;
}
}
System.out.println("未找到该学生!");
}
}
class Person {
private int id;
private String name;
private String gender;
private String birthday;
public Person(int id, String name, String gender, String birthday) {
this.id = id;
this.name = name;
this.gender = gender;
this.birthday = birthday;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
@Override
public String toString() {
return "编号:" + id + ",姓名:" + name + ",性别:" + gender + ",出生日期:" + birthday;
}
}
class Teacher extends Person {
private String department;
private String title;
private double salary;
public Teacher(int id, String name, String gender, String birthday, String department, String title, double salary) {
super(id, name, gender, birthday);
this.department = department;
this.title = title;
this.salary = salary;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
@Override
public String toString() {
return super.toString() + ",部门:" + department + ",职称:" + title + ",工资:" + salary;
}
}
class Student extends Person {
private double score;
private String field;
private String className;
public Student(int id, String name, String gender, String birthday, double score, String field, String className) {
super(id, name, gender, birthday);
this.score = score;
this.field = field;
this.className = className;
}
public double getScore() {
return score;
}
public void setScore(double score) {
this.score = score;
}
public String getField() {
return field;
}
public void setField(String field) {
this.field = field;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
@Override
public String toString() {
return super.toString() + ",高考分数:" + score + ",专业:" + field + ",班级:" + className;
}
}
```
以上是一个简单的学校人事管理系统的JAVA代码实现,可以实现教师和学生的基本信息添加、删除、修改和查询。
阅读全文