Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1.     public void altaAlumno(String queAlumno, int queNota)
  2.     {
  3.         if (numAlumnos >= MAX)
  4.             return;
  5.         if (queNota > 10)
  6.             queNota = 10;
  7.         else if (queNota <= 0)
  8.             queNota = 1;
  9.         nombres[numAlumnos] = queAlumno;
  10.         int posmin;
  11.         String aux = "";
  12.         for  (int i = 0; i < numAlumnos - 1; i++)
  13.         {
  14.             posmin = i;
  15.             for (int j = i + 1; j < numAlumnos; j++)
  16.                 if (nombres[j].compareToIgnoreCase(nombres[posmin]) < 0)
  17.                     posmin = j;
  18.             aux = nombres[posmin];
  19.             nombres[posmin] = nombres[i];
  20.             nombres[i] = aux;
  21.             notas[i] = queNota;
  22.     }
  23.     numAlumnos++;
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement