Execute the program and copy the console contents and paste it here. Be sure to add comments to what you paste here showing what the problem is and add comments to show what you want the output to look like.
Here is a suggestion for how you can make it easier for others to test your code. Change the Scanner definition to automatically provide the answers that you want so that the program will execute and display the problem. Change this line:
Scanner input = new Scanner(System.in);
to something like this:
Scanner input = new Scanner("first answer\nsecond\nthird\n ....for all answers");
Then when someone executes the program, there is no need to know what to answer,
you will have provided ALL of the answer needed to show the problem.
Also change the Random constructor call by giving it a seed so that the random numbers generated will be the same for the testing.
Have you tried debugging the code by adding printlns to show how the variables values change and how the execution flow goes? Since you know what your program is supposed to do, if you print out values, you should be able to see where there is a problem in the logic.