accepted method
- Student s
Tente d’affecter un étudiant à cette offre.
Retourne true
si l’affectation est réussie, sinon false
.
Implementation
bool accepted(Student s) {
//affectation d'une offre de séjour à un élève
print("s.year : ${s.year}");
print("this.b_slots : ${b_slots}");
print("this.specialization : ${specialization}");
print("s.get_next_year() : ${s.get_next_year()}");
//Les 2A ne pourront quand même pas prendre de formation en master !
if (s.year == 2 && this.b_slots > 0 ) {
print("ACCEPTED SCHOOL LICENCE");
reduce_slots(s);
return true;
}
else if (s.year > 2 && this.m_slots > 0 ) {
print("ACCEPTED SCHOOL MASTER");
reduce_slots(s);
return true;
}
return false;
}