class Student
{
private int sNo;
private String sName;
private String sSex;
private int sAge;
private int sJava;
//通过形参,完成对变量的赋值操作
public String getsName() { return sName; }
public String getsSex() { return sSex; }
public int getsAge() { return sAge; }
public int getsJava() { return sJava; }
public int getsNo() { return sNo; }
public Student(int n, String na, String se, int a, int j)
{
sNo=n; sName=na; sSex=se; sAge=a; sJava=j;
}
}
class Program
{
public static void main(String[] args)
{
Student[] stu=new Student[5];
stu[0]=new Student(572001,"张三","男",20,87);
stu[1]=new Student(572002,"张珊珊","女",20,56);
stu[2]=new Student(572003,"李四","男",20,79);
stu[3]=new Student(572004,"刘剑","男",21,82);
stu[4]=new Student(572005,"陈余","女",20,65);
for(int i=0;i<stu.length;i++)
{
System.out.println("学生:"+stu[i].getsName()+" 学号:"+stu[i].getsNo()+" 性别:"+stu[i].getsSex()+" 年龄:"+stu[i].getsAge() + " Java成绩:" + stu[i].getsJava());
System.out.println("-----------------------------------------------------");
}
int count=0,max=stu[0].getsJava(),min=stu[0].getsJava();
for(int i=0;i<stu.length;i++)
{
count+=stu[i].getsJava();
if(min<stu[i].getsJava()) min=stu[i].getsJava();
if(max>stu[i].getsJava()) max=stu[i].getsJava();
}
System.out.println("这个五个学生JAVA课程平均值:"+count/5.0);
System.out.println("这个五个学生JAVA课程最高分:"+max);
System.out.println("这个五个学生JAVA课程最高分:"+min);
}
}