import java.util.Scanner;
```...}
class Student{
String name=" ";
String sex=" ";
float mathGrade=0;
float xiandaiGrade=0;
float cGrade=0;
float javaGrade=0;
public void average(){
System.out.println("输出平均成绩");
float grade=(mathGrade+xiandaiGrade+cGrade+javaGrade)/4;
}
public void outputMessage(){
System.out.println("姓名"+name);
System.out.println("性别"+sex);
}
public void input(){
Scanner sa=new Scanner(System.in);
mathGrade=sa.nextFloat();
System.out.println("高数为"+mathGrade);
Scanner sb=new Scanner(System.in);
xiandaiGrade=sb.nextFloat();
System.out.println("线代为"+xiandaiGrade);
Scanner sd=new Scanner(System.in);
cGrade=sd.nextFloat();
System.out.println("c语言为"+cGrade);
Scanner se=new Scanner(System.in);
javaGrade=se.nextFloat();
System.out.println("面向过程为"+javaGrade);
Scanner sf=new Scanner(System.in);
sex=sf.next ();
System.out.println("性别为"+sex);
Scanner sg=new Scanner(System.in);
name=sg.next();
System.out.println("姓名为"+name);
}
}
public class information{
public static void main(String[] args){
Student[] a=new Student[2];
for(int i=0;i<=a.length;i++){
a[i].input();
}
int m=0;
while(m<2){
Scanner sg=new Scanner(System.in);
m=sg.nextInt();
System.out.println("要查询的序号"+m);
a[m].outputMessage();
a[m].average();
}
}
}