刚学完io老师布置的简易成绩管理程序作业,程序如下,本人程序如下(感谢室友及对门室友帮助调试):
源程序文件1:
package qwe;
import java.util.*;
class Student {
private String name;
private int java, sql, vb,id;
public int mc;
private int sco ;
public int getId()
{
return id;
}
public String getName()
{
return name;
}
public int getJAVA()
{
return java;
}
public int getSQL()
{
return sql;
}
public int getVB()
{
return vb;
}
public int getSco()
{
return sco;
}
public void setId( int i )
{
id = i;
}
public void setName(String n)
{
name = n;
}
public void setJAVA(int j)
{
java =j;
}
public void setSQL(int s)
{
sql = s;
}
public void setVB(int v)
{
vb = v;
}
public void setSco()
{
sco = vb + sql + java;
}
public String toString()
{
return id +" "+ name +" "+ java +" "+ sql +" "+ vb +" "+ sco + " " +mc;
}
}
源程序文件2:
package qwe;
import java.util.*;
class ComTypeComparator implements Comparator<Student>{
public int compare(Student o1, Student o2){
return (o1.getSco() < o2.getSco() ? -1 :(o1.getSco() == o2.getSco() ? 0 :1));
}
}
class ComTypeComparator2 implements Comparator<Student>{
public int compare(Student o1, Student o2){
return ((o1.getId() < o2.getId() ? -1 :(o1.getId() == o2.getId() ? 0 :1)));
}
}
class AchievementList {
public final static int CLASS_COUNT = 100;//班上人数
private final static int TSCO_JIGEXIAN = 180;//三科总分的及格线
private Student[] classstu = new Student[CLASS_COUNT];
private double Jave;//各科目班上平均成绩
private double Save;
private double Vave;
private double Tave;
private int maxJsco;//各项成绩班上最高分
private int maxSsco;
private int maxVsco;
private int maxTsco;
private int minJsco;//各项成绩班上最低分
private int minSsco;
private int minVsco;
private int minTsco;
private int Jbujicount;//各项成