lundi 31 octobre 2016

My if statement "between" is giving me wrong result

I am new here. I have a problem with my if/else if statement.

I got this:

  if (unalumno.notas >= "90" && unalumno.notas <= "100") {
      unalumno.notas = "A";
  } else if (unalumno.notas >= "80" && unalumno.notas <= "89") {
      unalumno.notas = "B";
  } else if (unalumno.notas >= "70" && unalumno.notas <= "79") {
      unalumno.notas = "C";
  } else if (unalumno.notas >= "60" && unalumno.notas <= "69") {
      unalumno.notas = "D";
  } else if (unalumno.notas <= "59") {
      unalumno.notas = "F";
  }

All the else if statement is giving to me the right result in letters, but the first if continue giving the result in numbers. Hope can understand me. Sorry for english lol

Have a good day

Aucun commentaire:

Enregistrer un commentaire