Hallo Leute,
ich habe schwierigkeit wo man bis 5 auffüllen soll. kann mir jemand ein tipp geben?
A schoolclass (in our particular “familiar” school) has at most 15 and at least 5 pupils. The constructor
has to check whether the parameter pupils has a proper amount of pupils. If there are not
enough pupils some “dummy” pupils will be added (you can give each of them a number). If
the parameter has more pupils, only the first 15 will be accepted!
danke vielmals
Sahra
ich habe schwierigkeit wo man bis 5 auffüllen soll. kann mir jemand ein tipp geben?
A schoolclass (in our particular “familiar” school) has at most 15 and at least 5 pupils. The constructor
has to check whether the parameter pupils has a proper amount of pupils. If there are not
enough pupils some “dummy” pupils will be added (you can give each of them a number). If
the parameter has more pupils, only the first 15 will be accepted!
Java:
if(schueler.length <5){
for(int i = 0; i < 5; i++){
this.schueler= schueler;
}
}else if(schueler.length > 15){
for(int i = 0; i < 15; i++){
this.schueler= schueler;
}
}else {
this.schueler = schueler;
}
danke vielmals
Sahra