I've got a code that goes like this:
Expand|Select|Wrap|Line Numbers
- for(i=0 ; i <= numberofstudents ; i++)
- {
- //looking for the students that have chosen maths on HL among all the students
- if (students[i].maths == "Higher level")
- {
- //checking if those students have free time on given lessons
- if (students[i].mondaylesson1 == false && students[i].mondaylesson2 == false)
- {
- //if they do, assigning the subject to the timetable
- addmathstotimetable();
- numberofmathstoadd -=2;
- students[i].mondaylesson1 = true;
- students[i].mondaylesson2 = true;
- }
- }
- }