-5
With this function my program works, but when I add another error condition:
if ((nota >= 6) && (frequencia >= 75)){
alert("Aprovado");
}
else if (frequencia >= 50){
alert("Recuperação");
}
else{
alert("Reprovado");
}
I want to add one more condition there that error:
if ((nota >= 6) && (frequencia >= 75)) {
alert("Aprovado");
}
else if (frequencia >= 50) {
alert("Recuperação");
}
else {
alert("Reprovado");
}
//essa
else if (nota >= 4) {
alert("Aluno de Recuperação");
} else {
alert("Aluno Reprovado");
}
}
I suggest you read this: [Ask]
– user28595
The
else
must be the last resort when allelse if
failed, so he must get last and can only have one.– Sam
This u tlimo block of comparison that you aim to give error, has to do with the first or are separate things?
– Sam
To put it simply: The
else {
is the last. You can’t have anotherelse if
after aelse {
.– Victor Stafusa