When I was putting this code for input three name and mark. but the name doesn't looping 3 time just once I could input, directly the code jumped to input mark1
. how can I check to input three name please!
public void in_array(String x[], float x2[], float x3[])
{
for(i=0; i<x.length;i++)
{
System.out.println("Enter name: ");
x[i] = in.nextLine();
System.out.println("Enter Mark one: ");
x2[i] = in.nextFloat();
System.out.println("Enter Mark two: ");
x3[i] = in.nextFloat();
}
}
Output:
enter name:
Enter mark one: