Java quiz issue
<p>I'm in a little bit of a problem. I've been doing the java courses from this site: <a href="http://programmingbydoing.com/" rel="nofollow">http://programmingbydoing.com/</a> and i've hit a dead end on this lesson: <a href="http://programmingbydoing.com/a/a-little-quiz.html" rel="nofollow">http://programmingbydoing.com/a/a-little-quiz.html</a>.</p>

<p>I have no idea how to keep track of the answers, thought i believe i did everything right overall. Been mashing my brains on this for the last couple of hours, please help. Thanks.</p>

<pre><code>import java.util.Scanner;

public class Quiz
{
    public static void main(String[] args)
    {
    Scanner keyboard = new Scanner(System.in);

    String reply;
    int answer;
    int numberofquizes = 3;

    int q1a1 = 1;
    int q1a2 = 2;
    int q1a3 = 3;
    int q2a1 = 1;
    int q2a2 = 2;
    int q3a1 = 1;
    int q3a2 = 2;
    int q3a3 = 3;

    System.out.print("Are you ready for this quiz?");
    reply = keyboard.next();

    System.out.println("Okay, here it comes!");
    System.out.println("");
    System.out.println("Q1) What is the capital of Alaska?");
    System.out.println("    "+ q1a1 +") Melbourne");
    System.out.println("    "+ q1a2 +") Anchorage");
    System.out.println("    "+ q1a3 +") Jouneau");

    System.out.print("Your answer: ");
    answer = keyboard.nextInt();

    if (answer == 1)
    {
        System.out.println("Incorrect!");
    }
    else if (answer == 2)
    {
        System.out.println("Incorrect!");
    }
    else if (answer == 3)
    {
        System.out.println("That's right!");
    }
    System.out.println();
    System.out.println("Q2) Can you store the value \"cat\" in a variable of type int?");
    System.out.println("    "+ q2a1 +") yes");
    System.out.println("    "+ q2a2 +") no");

    System.out.print("Your answer: ");
    answer = keyboard.nextInt();

    if (answer == 1)
    {
        System.out.println("Incorrect!");
    }
    else if (answer == 2)
    {
        System.out.println("That's right!");
    }

    System.out.println();
    System.out.println("Q3) What is the result of 9+6/3?");
    System.out.println("    "+ q3a1 +") 5");
    System.out.println("    "+ q3a2 +") 11");
    System.out.println("    "+ q3a3 +") 15/3");

    System.out.print("Your answer: ");
    answer = keyboard.nextInt();

    if (answer == 1)
    {
        System.out.println("Incorrect!");
    }
    else if (answer == 2)
    {
        System.out.println("That's right!");
    }
    else if (answer == 3)
    {
        System.out.println("Incorrect!");
    }

    System.out.println();
    System.out.println("Overall, you got x out of "+ numberofquizes +" ");
    System.out.println("Thanks for playing!");
}
</code></pre>

<p>}       </p>
