Welcome to the Ranch
Good thing you found the
code button, but please indent the code inside the code tags, too.
Just before the offending line, add a line for
testing which prints out the
int which you have just read (I think snum). Does that give the right value?
What have you been told nextLine() does? Did anybody tell you it reads the next line? Does your book tell youit reads the next line? Becuase it doesn’t. It tells you something different
here, but it may not be clear. If you read something and then call nextLine(), it reads the remainder of the line. As you will see from
this message, it can even read a zero‑length line. Which doesn’t do you much good. In that sort of instance, you need the enter key be pressed before the prompt. The simplest thing to try to call nextLine() and discard its return value before trying to display the prompt.