Skip to content
Snippets Groups Projects
Commit 854f6072 authored by Samuel Turpin's avatar Samuel Turpin :computer:
Browse files

tp4 finish

parent 4fdaee0b
Branches
No related tags found
No related merge requests found
......@@ -2,9 +2,36 @@ package tp04;
public class StudentAbs extends Student
{
public StudentAbs(Person pers, double[] grades)
private int nbAbsence;
public StudentAbs(Student pers, double[] grades, int abs)
{
super(pers, grades);
this.nbAbsence=abs;
}
public int getNbAbsence() {
return nbAbsence;
}
public boolean warning(int thresholdAbs, double thresholdAvg)
{
return getAverage() <= thresholdAvg || getNbAbsence() >= thresholdAbs;
}
public boolean validation(int thresholdAbs, double thresholdAvg)
{
return getAverage() >= thresholdAvg || getNbAbsence() <= thresholdAbs;
}
public boolean equals(StudentAbs abs)
{
return abs.getNbAbsence() == this.getNbAbsence();
}
@Override
public String toString()
{
return getPers().getForename()+" "+getPers().getName()+", nbAbs="+getNbAbsence();
}
}
\ No newline at end of file
package tp04;
public class YearGroup extends StudentAbs
{
public YearGroup(Student pers, double[] grades, int abs)
{
super(pers, grades, abs);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment