0
I need to make the array received from the function HAPPENS (in this function I receive the schedules of students who entered early, late and punctual. ) go to the function OPENINGS (and here I inform if the class happens or not, as shown in the statement below), ie I want to pull the information received in HAPPENS, That’s what the exercise asks for:
Write the following functions: 1. happens, that says if the class will succeed according to the array of incoming students. 2. openings, that uses an array with the arrays of students who entered the others days, and the minimum number of students, and say which days the classes happened and which did not. For example:
aberturas([alunosDaSegunda, alunosDaTerça, alunosDaQuarta],
[true, false, false]
This is my code so far, but I don’t know if the logic is correct, I need help to understand.
function acontece(alunos){
var alunosDaSegunda = []
var alunosDaTerca = []
var alunosDaQuarta = []
for (var i = 0; i < alunos.lenght; i++){
if(i <= 0){
return alunos
}else
return
}
}
function aberturas(temAula){
var alunosDaSegunda = []
var alunosDaTerca = []
var alunosDaQuarta = []
for(var i = 0; i < temAula.lenght; i++ )
if(temAula > 2 ){
return temAula
}else
return
}
Okay, thank you so much for the explanation!!
– user139817