class Student{
int gra1,gra2,gra3;
}
class Undergraduate extends Student{
int gra1,gra2,gra3;
void passun(){
if((gra1+gra2+gra3)/3>=60)
System.out.println("通过");
else System.out.println("不通过");
}
}
class Graduate extends Student{
int gra1,gra2,gra3;
void passgr(){
if((gra1+gra2+gra3)/3>=80)
System.out.println("通过");
else System.out.println("不通过");
}
}
public class StudentDemo{
public static void main(String args[]){
Undergraduate m=new Undergraduate();
Graduate n=new Graduate();
m.gra1=59;
m.gra2=62;
m.gra3=71;
n.gra1=55;
n.gra2=88;
n.gra3=67;
m.passun();
n.passgr();
}
}
int gra1,gra2,gra3;
}
class Undergraduate extends Student{
int gra1,gra2,gra3;
void passun(){
if((gra1+gra2+gra3)/3>=60)
System.out.println("通过");
else System.out.println("不通过");
}
}
class Graduate extends Student{
int gra1,gra2,gra3;
void passgr(){
if((gra1+gra2+gra3)/3>=80)
System.out.println("通过");
else System.out.println("不通过");
}
}
public class StudentDemo{
public static void main(String args[]){
Undergraduate m=new Undergraduate();
Graduate n=new Graduate();
m.gra1=59;
m.gra2=62;
m.gra3=71;
n.gra1=55;
n.gra2=88;
n.gra3=67;
m.passun();
n.passgr();
}
}