When I run my program my for loop outputs the line "Enter a game score?" twice before I am able to input sometimes, have a made a silly error while constructing it.
import java.util.Scanner;
public class Project {
public static void main (String[] args){
Scanner scan = new Scanner(System.in);
System.out.println("What is your name?");
String playername = scan.nextLine();
System.out.println("How many games will you be entering?");
int numofgames = scan.nextInt();
/* Creating the arrays*/
String[] game = new String[numofgames];
int[] scores = new int [numofgames];
int[] mins = new int [numofgames];
/* Creating a temp array to store the game data before splitting*/
String[] temparray = new String[numofgames];
/*Getting the users game data and storing it into the temp array*/
for (int count=1; count <= numofgames; count++){
System.out.println("Enter a game score?(Game name:Scores:Mins)");
temparray[count] = scan.nextLine();
}}}