import java.util.Scanner;
public class test {
public static void main(String[] args)
{
Scanner input = new Scanner (System.in);
boolean US1 = false;
boolean game;
int score = 1;
int wage = 0;
int fin_score = 0;
String ans;
if (US1 == false)
{
game = false;
System.out.println (score);
System.out.println("Enter a wager");
wage = input.nextInt();
}
if (wage < score)
{
System.out.println ("What is the capital of Liberia?");
ans = input.nextLine();
if (ans.equalsIgnoreCase("Monrovia"))
{
System.out.println ("You got it right!");
System.out.println ("Final score " + fin_score);
}
}
// TODO Auto-generated method stub
}
}
For some reason once I enter a value for wage, the code prints "What is the capital of Liberia?" then terminates. Im not sure what is going on, why the scanner will not let me input the answer for the question