教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 范文大全 > 行业范文 >

java学生管理系统源代码

来源:网络收集 时间:2026-09-04
导读: java学生管理系统源代码 import java.io.Serializable; public class Course implements Serializable{ private String courseName; private int courseGrade; Course(){ courseName=null; courseGrade=0; } public void setCourseNameValue(String ss){ thi

java学生管理系统源代码

import java.io.Serializable;

public class Course implements Serializable{

private String courseName;

private int courseGrade;

Course(){

courseName=null;

courseGrade=0;

}

public void setCourseNameValue(String ss){

this.courseName=ss;

}

public void setCourseGradeValue(int dd){

this.courseGrade=dd;

}

public String getCourseNameValue(){

return this.courseName;

}

public int getCourseGradeValue(){

return this.courseGrade;

}

public boolean equals(Object o) {

if (o == null){ return false;}

else {

if (o instanceof Course) {

Course rec = (Course) o;

if (this.courseName.equals(rec.getCourseNameValue())) {

return true;

}

}

return false;

}

}

}

---------------------------------------------------------------------------------------------------------------

java学生管理系统源代码

import java.io.Serializable;

import java.util.Arrays;

import java.util.LinkedList;

import java.util.List;

public class Student implements Serializable, Comparable{

private String studentName;

private int studentId;

//private int studentCourseAmount=4;

private LinkedList courseList;

Student(){

studentName=null;

studentId=0;

courseList=new LinkedList();

}

public void setStudentNameValue(String name){//确定学生名称

this.studentName=name;

}

public void setStudentIdValue(int id){//确定学生学号

this.studentId=id;

}

public void setStudentCourseList(LinkedList list){//传入课程链list

this.courseList=list;

// System.out.println("例:0916 张磊 语文 98 数学 67");

}

public void setCourseGrade(Object o){//将与学科o同名的学科的成绩改为o的成绩 for(int i=0;i<this.courseList.size();i++){

Course obj=new Course();

obj=(Course) this.courseList.get(i);

if(obj.equals(o)){

Course res=(Course) o;

obj.setCourseGradeValue(res.getCourseGradeValue());

}

}

}

java学生管理系统源代码

public String getStudentNameValue(){//取得学生姓名

return this.studentName;

}

public int getStudentId(){//取得学生学号

return this.studentId;

}

public LinkedList getstudentCourseList(){//得到成绩链的首地址

return this.courseList;

}

public long getStudentCourseGrade(Course o){//取得与o同名的成绩值,尚有错误

long temp = 0;

List courTemp=this.getstudentCourseList();

Course obj;

//System.out.println(courTemp.indexOf(o));

int i=courTemp.indexOf(o);

obj=(Course) courTemp.get(i);

temp=obj.getCourseGradeValue();

return temp;

}

public boolean equals(Object o) {//判定两个对象是否相同,姓名或学号相同

if (o == null) return false;

else {

if (o instanceof Student) {

Student rec = (Student) o;

System.out.println(rec.getStudentNameValue());

if (this.studentName.equals(rec.getStudentNameValue())

this.studentId==rec.getStudentId()) {

return true;

}

}

return false;

}

}

public int compareTo(Object O){

Student obj=(Student) O;

int thisSum=0;

for(int i=0;i<this.courseList.size();i++){

Course cour=(Course) this.courseList.get(i); ||

java学生管理系统源代码

}

} thisSum += cour.getCourseGradeValue(); } int OSum=0; for(int i=0;i<obj.getstudentCourseList().size();i++){ Course cour=(Course) obj.getstudentCourseList().get(i); OSum += cour.getCourseGradeValue(); } if(thisSum<OSum) { return -1; } if(thisSum>OSum) { return 1; } return 0;

import java.awt.Color;

import java.awt.Font;

import java.io.BufferedReader;

//import java.util.*;

import java.io.FileNotFoundException;

import java.io.FileOutputStream;

import java.io.FileWriter;

import java.io.IOException;

import java.io.InputStreamReader;

import java.io.PrintWriter;

import java.io.Serializable;

import java.sql.Date;

import java.text.DecimalFormat;

import java.text.NumberFormat;

import java.util.Arrays;

import java.util.LinkedList;

import java.util.List;

java学生管理系统源代码

import java.util.Scanner;

import java.util.*;

import org.jfree.chart.ChartFactory;

import org.jfree.chart.ChartFrame;

import org.jfree.chart.ChartUtilities;

import org.jfree.chart.JFreeChart;

import org.jfree.chart.axis.CategoryAxis;

import org.jfree.chart.axis.NumberAxis;

import http://doc.guandang.netbels.StandardPieSectionLabelGenerator;

import org.jfree.chart.plot.CategoryPlot;

import org.jfree.chart.plot.PiePlot;

import org.jfree.chart.plot.PlotOrientation;

import org.jfree.chart.title.TextTitle;

import org.jfree.data.category.DefaultCategoryDataset;

import org.jfree.data.general.DefaultPieDataset;

public class Teacher {

private String teacherName;

private List studentList;

Teacher(){

teacherName=null;

studentList=new LinkedList();

}

public void setTeacherName(String name){

this.teacherName=name;

}

public void setStudentList(LinkedList list){

this.studentList=list;

}

public String getTeacherName(){

return this.teacherName;

}

public List getStudentList(){

return this.studentList;

}

public void addStudent(Object o){//添加学生o

//Date date=new Date(0);

if(o!=nul …… 此处隐藏:14187字,全部文档内容请下载后查看。喜欢就下载吧 ……

java学生管理系统源代码.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/fanwen/986593.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)