How to cause a second prompt to run after the first.
I am working on an assignment for a first year Java course. For the program I am writing, I need to be able to ask the user for a card (as in deck of cards) size, and then ask them for a card suit. The program will then draw out the card suit in *'s. The printing is not my problem. This is the beginning of my main method:
System.out.println( "Which size card do you want? (0 or bigger): " );
int size = scan.nextInt();
if( size < 0 )
System.out.println( "Size was too small (" + size + ")." );
size = 0;
System.out.println( "I'll use " + size + " instead." );
System.out.println( "Which card suit? (diamonds, hearts, spades): ");
String suit = scan.nextLine();
The problem is the program runs through the first prompt: "Which size card do you want? (0 or bigger): ", then will print the second prompt: "Which card suit? (diamonds, hearts, spades): ", but it won't pause at the second prompt. It continues on to the next block statement. Any suggestions? Thanks in advance.
Moderator Edit: Code tags added