第三次实训
package shixun;
import java.util.*;
public class Student {
String name;
char sex;
int age;
String number;
float[] score = new float[5];
public Student(String name,char sex,int age,String number) {
this.name = name;
this.sex = sex;
this.age = age;
this.number = number;
}
public static void main(String[] args) {
Student S01 = new Student("张三",'男', 19, "201801");
float[] score1 = new float[]{100,99,98,97,96};
Student S02 = new Student("李四",'女', 18, "201802");
float[] score2 = new float[]{77,88,99,97,96};
{ System.out.println("姓名:"+S01.name+"\n"+"性别"+S01.sex+"\n"+"年龄"+S01.age+"\n"+"学号:"+S01.number+"\n");
for(int i =0; i<5;i++){
System.out.println("5门课程的成绩:"+score1[i]);}
{ System.out.println("\n姓名:"+S02.name+"\n"+"性别"+S02.sex+"\n"+"年龄"+S02.age+"\n"+"学号:"+S02.number+"\n");
for(int j =0; j<5;j++){
System.out.println("5门课程的成绩:"+score2[j]);}
}
}
}}
