package Work0924;
public class Test {
private static Student[] std = null;
//根据姓名查询成绩
public static void search(String name){
for(int i=0;i<std.length;i++){
if(std[i].getName().contains(name)){
System.out.println(std[i]);
}
}
}
//查询不及格成绩人数
public static void bjg(){
System.out.println("英语不及格的有:");
int a=0;
for(int i=0;i<std.length;i++){
if(std[i].getEnglish()<60){
System.out.print(std[i].getName()+",");
a++;
}
}
System.out.print(a);
System.out.println();
System.out.println("数学不及格的有:");
int b=0;
for(int i=0;i<std.length;i++){
if(std[i].Highmath()<60){
System.out.print(std[i].getName()+",");
b++;
}
}
System.out.print(b);
System.out.println();
System.out.println("体育不及格的有:");
int c=0;
for(int i=0;i<std.length;i++){
if(std[i].getSport()<60){
System.out.print(std[i].getName()+",");
c++;
}
}
System.out.print(c);
}
public static void main(String[] args) {
std = new Student[5];
std[0] = new Student(123456,"张三",60,70,80);
std[1] = new Student(123457,"李四",50,70,45);
std[2] = new Student(123458,"王五",55,70,77);
std[3] = new Student(123459,"张三丰",60,25,25);
std[4] = new Student(123451,"张无忌",60,54,26);
search("张");
bjg();
}
}