public class guanli {
String sex,name;
int num,Chinese,English,Math;
double getA(){
double a;
a = (Chinese+English+Math)/3;
return a;
}
public static void main(String[] args) {
// TOaDO Auto-generated method stub
guanli stu1 = new guanli();
guanli stu2 = new guanli();
guanli stu3 = new guanli();
guanli stu4 = new guanli();
stu1.name = "张艺兴";
stu1.sex = "男";
stu1.num = 162507200;
stu1.Chinese = 86;
stu1.Math = 87;
stu1.English = 88;
stu1.getA();
stu2.name = "胡歌";
stu2.sex = "男";
stu2.num = 162507201;
stu2.Chinese = 93;
stu2.Math = 90;
stu2.English = 79;
stu2.getA();
stu3.name = "王凯";
stu3.sex = "男";
stu3.num = 162507202;
stu3.Chinese = 89;
stu3.Math = 92;
stu3.English = 87;
stu3.getA();
stu4.name = "甜馨";
stu4.sex = "女";
stu4.num = 162507203;
stu4.Chinese = 99;
stu4.Math = 88;
stu4.English = 77;
stu4.getA();
System.out.println("姓名 性别 学号 语文 数学 英语 平均值");
System.out.println(stu1.name+" "+stu1.sex+" "+stu1.num+" "+stu1.Chinese+" "+stu1.Math+" "+stu1.English+" "+stu1.getA());
System.out.println(stu2.name+" "+stu2.sex+" "+stu2.num+" "+stu2.Chinese+" "+stu2.Math+" "+stu2.English+" "+stu2.getA());
System.out.println(stu3.name+" "+stu3.sex+" "+stu3.num+" "+stu3.Chinese+" "+stu3.Math+" "+stu3.English+" "+stu3.getA());
System.out.println(stu4.name+" "+stu4.sex+" "+stu4.num+" "+stu4.Chinese+" "+stu4.Math+" "+stu4.English+" "+stu4.getA());
}
}
String sex,name;
int num,Chinese,English,Math;
double getA(){
double a;
a = (Chinese+English+Math)/3;
return a;
}
public static void main(String[] args) {
// TOaDO Auto-generated method stub
guanli stu1 = new guanli();
guanli stu2 = new guanli();
guanli stu3 = new guanli();
guanli stu4 = new guanli();
stu1.name = "张艺兴";
stu1.sex = "男";
stu1.num = 162507200;
stu1.Chinese = 86;
stu1.Math = 87;
stu1.English = 88;
stu1.getA();
stu2.name = "胡歌";
stu2.sex = "男";
stu2.num = 162507201;
stu2.Chinese = 93;
stu2.Math = 90;
stu2.English = 79;
stu2.getA();
stu3.name = "王凯";
stu3.sex = "男";
stu3.num = 162507202;
stu3.Chinese = 89;
stu3.Math = 92;
stu3.English = 87;
stu3.getA();
stu4.name = "甜馨";
stu4.sex = "女";
stu4.num = 162507203;
stu4.Chinese = 99;
stu4.Math = 88;
stu4.English = 77;
stu4.getA();
System.out.println("姓名 性别 学号 语文 数学 英语 平均值");
System.out.println(stu1.name+" "+stu1.sex+" "+stu1.num+" "+stu1.Chinese+" "+stu1.Math+" "+stu1.English+" "+stu1.getA());
System.out.println(stu2.name+" "+stu2.sex+" "+stu2.num+" "+stu2.Chinese+" "+stu2.Math+" "+stu2.English+" "+stu2.getA());
System.out.println(stu3.name+" "+stu3.sex+" "+stu3.num+" "+stu3.Chinese+" "+stu3.Math+" "+stu3.English+" "+stu3.getA());
System.out.println(stu4.name+" "+stu4.sex+" "+stu4.num+" "+stu4.Chinese+" "+stu4.Math+" "+stu4.English+" "+stu4.getA());
}
}