How many guests will there be there? 4
Enter the choice for guest 1
Enter the choice for guest 2
After I enter the number of guests, guest 1 and 2 fall right under each other, without giving me the chance to input the choice for guest 1, it goes to guest 2. how can I fix this?
public static void main(String[] args) {
Scanner simpleInput= new Scanner (System.in);
int guest;
String choice;
System.out.println("Welcome to Tying the Knot Wedding Planner Guide");
System.out.println();
System.out.println("For each guest, please enter he/her choice for dinner: Beef, Chicken, Fish, or\r\n" +
"Vegetarian.\r\n" +
"");
System.out.print("How many guests will there be there? ");
guest=simpleInput.nextInt();
while (guest <0 )
{
System.out.println ( "That was not a valid number, try again. " );
System.out.println("How many guests will there be there? ");
guest=simpleInput.nextInt();
}
for (int x = 1; x < guest; x++ )
{
System.out.println("Enter the choice for guest " + x);
choice=simpleInput.nextLine();
}
System.out.println("There will be " + guest + " meals");
}