I need you to ask the name of the students after having declared the number of students, but when entering the amount does not allow me to enter the name of the first student and I have one round of the cycle, for example: if I say that I have 5 students just let me write 4 and the first is empty How could you solve that?
import java.util.Scanner;
public class Cali{
public static void main(String args[]){
int cantidad = 0;
int calificacion = 0;
String alumno = "";
Scanner user = new Scanner(System.in);
System.out.println("Ingrese la cantidad de alumnos");
cantidad = user.nextInt();
System.out.println("");
int alumnos[] = new int[cantidad];
int calificaciones[] = new int[cantidad];
String nombres[] = new String[cantidad];
for(int i = 0; i < alumnos.length; i++)
{
System.out.println("Ingrese el nombre del alumno: ");
alumno = user.nextLine();
nombres[i] = alumno;
}
System.out.println("");
for(int i = 0; i < alumnos.length; i++)
{
System.out.print("Ingrse la calificacion del alumno(a) " + nombres[i] + ":");
calificacion = user.nextInt();
calificaciones[i] = calificacion;
}
System.out.println("");
for(int i = 0; i < alumnos.length; i++)
{
if(calificaciones[i] <= 5)
{
System.out.println("El(La) alumno(a) " + nombres[i] + " reprobo con: " + calificaciones[i]);
} else if(calificaciones[i] == 10)
{
System.out.println("El(La) alumno(a) " + nombres[i] + " aprobo con una excelente calficacion de " + calificaciones[i]);
} else
{
System.out.println("El(La) alumno(a) " + nombres[i] + " aprobo con: " + calificaciones[i]);
}
}
}
}