answers matching program in java
<p>This is the code, and i have taken 4 questions initially and applied the input method to  <br/> only question 1. I want the input scanner variable of question 1 to be stored in a variable with automatic numbering as the for loops runs till 10 my variable name changes so that i could later call the same question again and compare the answers with if condition. For example I'm taking 10 inputs for "write 10 colors names":
i want those inputs.. to be used later again..!  <br/><br>
Lets look at it step by step..  <br/><br>
1. Show randomly 1 question out of 10.<br>
2. The question's answers should be 10, for example .. write 10 colors, write 10 countries! <br/> 
3. when the user enters all 10 answers,the program should again display the same question and <br/>ask the user to repeat the answers which he/she entered earlier !  <br/>
4. If the user manages to write the answers in correct sequence in which he entered earlier, the program should add +10 score for each correct sequence answer.</p>

<pre><code>import java.util.Scanner;
public class Game {

public static void main (String arg[])
{
    java.util.Random r = new java.util.Random();

    String q1 ="Write 10 color names: ";
    String q2 = "Write 10 city names:";
    String q3 = "Write 10 city names:";
    String q4 = "Write 10 city names:";

    int a = r.nextInt(4);
    int abc = 0;
    Scanner question = new Scanner(System.in);
    if (a==0)
    {



        System.out.println(q1);
        for(int i=0; i&lt;10; i++){
        abc = question.nextInt();
        abc++; 

    }
        System.out.println(abc);
    }

        else if (a==1)
    {


            System.out.println(q2);
    }


        else if (a==2)
    {


            System.out.println(q3);
    }


        else if (a==3)
    {


            System.out.println(q4);
    }

    if(a==0){
            System.out.println(q1);
             for (int g=0; g&lt;10; g++)
             abc = question.nextInt();
             abc++;
            }






}
}
</code></pre>
