After giving the input to writtenBooks, it skips the option to enter input for authorDemographics and continues to the next prompt. At this point, regardless of the input i typed it continuously prompts me "Type 1 for Yes. Type 2 for No." Looking forward to any feedback. Thanks
/* body */
System.out.println ("Hello, welcome to the convention!");
System.out.println ("Please enter your full name: ");
authorName = input.nextLine ();
System.out.flush();
System.out.println ("Please enter the amount of books you have written: ");
writtenBooks = input.nextInt ();
System.out.println ("Who is your target demographic for your books?");
System.out.println ("Type: Under 3 , 3 through 7 , 8 through 10 , 11 through 13 , or 14 and older.");
authorDemographics = input.nextLine ();
System.out.flush();
/* loop */
demoLoop = 0;
while (!ageGroup [4].equals(authorDemographics) && demoLoop == 0) {
System.out.println ("Would you like to enter more demographics?");
System.out.println ("Type 1 for Yes. Type 2 for No.");
question = input.nextInt (); }
if (question == 1) {
System.out.println ("Who is your target demographic for your books?");
System.out.println ("Type: Under 3, 3 through 7, 8 through 10, 11 through 13, or 14 and older.");
authorDemographics01 = input.nextLine ();
System.out.flush();
} else {
demoLoop = 1;
System.out.println ("Author Name:" + authorName);
System.out.println ("First Demographic: " + authorDemographics);
System.out.println ("Second Demographic: " + authorDemographics01);
System.out.println ("Amount of books written: " + writtenBooks);
question = input.nextInt (); }nextIntdoesn't read in the new line, meaning that the new line is then fed intonextLine, and this is repeated over and over.