java教学管理系统项目代码

Java教学管理系统项目代码

Java教学管理系统是一个用于管理学校教学和学生的管理系统。该项目代码包含了许多用于处理学生,教师,课程和成绩等方面的逻辑和功能。

以下是一个简单的Java教学管理系统项目代码的概述:

“`
import java.util.ArrayList;
import java.util.Scanner;

public class Student {
private String name;
private String gender;
private String phone;
private String address;

public Student(String name, String gender, String phone, String address) {
this.name = name;
this.gender = gender;
this.phone = phone;
this.address = address;
}

public String getName() {
return name;
}

public String getGender() {
return gender;
}

public String getPhone() {
return phone;
}

public String getAddress() {
return address;
}

public void setName(String name) {
this.name = name;
}

public void setGender(String gender) {
this.gender = gender;
}

public void setPhone(String phone) {
this.phone = phone;
}

public void setAddress(String address) {
this.address = address;
}

public String toString() {
return \”Name: \” + name + \”, Gender: \” + gender + \”, Phone: \” + phone + \”, Address: \” + address;
}
}

public class Teacher {
private String name;
private String gender;
private String phone;
private String address;

public Teacher(String name, String gender, String phone, String address) {
this.name = name;
this.gender = gender;
this.phone = phone;
this.address = address;
}

public String getName() {
return name;
}

public String getGender() {
return gender;
}

public String getPhone() {
return phone;
}

public String getAddress() {
return address;
}

public void setName(String name) {
this.name = name;
}

public void setGender(String gender) {
this.gender = gender;
}

public void setPhone(String phone) {
this.phone = phone;
}

public void setAddress(String address) {
this.address = address;
}

public String toString() {
return \”Name: \” + name + \”, Gender: \” + gender + \”, Phone: \” + phone + \”, Address: \” + address;
}
}

public class Course {
private String name;
private String description;
private String url;

public Course(String name, String description, String url) {
this.name = name;
this.description = description;
this.url = url;
}

public String getName() {
return name;
}

public String getDescription() {
return description;
}

public String getUrl() {
return url;
}

public void setName(String name) {
this.name = name;
}

public void setDescription(String description) {
this.description = description;
}

public void setUrl(String url) {
this.url = url;
}

public String toString() {
return \”Name: \” + name + \”, Description: \” + description + \”, URL: \” + url;
}
}

public class Grade {
private int score;
private String grade;

public Grade(int score, String grade) {
this.score = score;
this.grade = grade;
}

public int getScore() {
return score;
}

public String getGrade() {
return grade;
}

public void setScore(int score) {
this.score = score;
}

public void setGrade(String grade) {
this.grade = grade;
}

public String toString() {
return \”Score: \” + score + \”, Grade: \” + grade;
}
}

public class Booking {
private Student student;
private Teacher teacher;
private Course course;
private Grade grade;

public Booking(Student student, Teacher teacher, Course course, Grade grade) {
this.student = student;
this.teacher = teacher;
this.course = course;
this.grade = grade;
}

public void addStudent() {
student.setName(student.toString());
student.setGender(student.getGender());
student.setPhone(student.getPhone());
student.setAddress(student.getAddress());
this.student = student;
}

public void addTeacher() {
teacher.setName(teacher.toString());
teacher.setGender(teacher.getGender());
teacher.setPhone(teacher.getPhone());
teacher.setAddress(teacher.getAddress());
this.teacher = teacher;
}

public void addCourse() {
course.setName(course.toString());
course.setDescription(course.getDescription());
course.setUrl(course.getUrl());
this.course = course;
}

public void addGrade() {
grade.setScore(grade.getScore());
grade.setGrade(grade.getGrade());
this.grade = grade;
}

public void addBooking() {
Booking booking = new Booking(student, teacher, course, grade);
System.out.println(\”Book Booking created successfully.\”);
}

public void printBooking() {
System.out.println(\”Booking:\”);
System.out.println(\”Student: \” + student.toString());
System.out.println(\”Teacher: \” + teacher.toString());
System.out.println(\”Course: \” + course.toString());
System.out.println(\”Grade: \” + grade.toString());
System.out.println(\”Booking created successfully.\”);
}
}
“`

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

(0)
上一篇 2025年1月14日 下午1:17
下一篇 2025年1月14日 下午1:29

相关推荐