Basic program termination<>
This question already has an answer here:
- How do I compare strings in Java? 23 answers
The program terminates because it takes the newline character the end-user added after the last integer as the end of the nextLine().
Let's say the user enters 123 and presses Enter. At this point, the data in the buffer looks like this:
   [\n]
After you call scan.nextInt() the integer part is removed, but the [\n] remains in the buffer. When you call scan.nextLine(), that end-of-line marker is the first character the scanner sees, so it treats that \n as an empty string, which is returned to your program. You can fix it by calling scan.nextLine() before taking a full-line input.
However, this by itself will not fix your program, because you should be comparing strings using equals(), e.g. like this
not like this
if (fc1 == "A") // <<== This will not work correctly