帮我解释下程序JAVA

来源:百度知道 编辑:UC知道 时间:2024/06/25 08:45:19
class sclass
{ String classid;
int credit;
sclass(String classid,int credit)
{ this.classid=classid;
this.credit=credit;
}
};

class Student
{ String sid;
String sname;
char sex;
float avgscore;
float []score=new float[3];

Student(String id,String name,char sex,float s1,float s2,float s3)
{ this.sid=id;
this.sname=name;
this.sex=sex;
this.score[0]=s1;
this.score[1]=s2;
this.score[2]=s3;
}
Student(){};
Student(String id,String name,char sex)
{ this.sid=id;
this.sname=name;
this.sex=sex;
}
void print()
{ System.out.println("id:"+this.sid+"\t\t name:"+this.sname+"\t sex:"+this.sex);
System.out.println(&

慢慢学

得两分再说,然后建议你看JAVA基础,觉得我的建议好就给我分吧!!
拿来!!

accuscore() 求出了平均分,as是总的学分*分数,cs总学分
sort() 按平均分高到低进行排序
其他的用来存数据的

不知你要怎么解释,你这个程序主要是为了输出学生的信息,然后可以更改某些信息!要一句句都解释出来没那么多时间!