Java exercise for checkout
<p>I'm trying some Java recently and look for some review of my style. If You like to look at this exercise placed in the image, and tell me if my style is good enought? Or maybe it is not good enought, so You can tell me on what aspect I should work more, so You can help me to improve it?</p>

<p><a href="http://i.stack.imgur.com/dwIb5.png" rel="nofollow">exercise for my question</a></p>

<pre><code>/*
 * File: MathQuiz.java
 * 
 * This program produces Math Quiz. 
 */
import acm.program.*;
import acm.util.*;

public class MathQuiz extends ConsoleProgram {

    /* Class constants for Quiz settings. */
    private static final int CHANCES = 3;
    private static final int QUESTIONS = 5;
    private static final int MIN = 0;
    private static final int MAX = 20;

    /* Start program. Number of questions to ask is assigned here. */
    public void run() {
        println("Welcome to Math Quiz");
        while(answered != QUESTIONS) {
            produceNumbers();
            askForAnswer();
        }
        println("End of program.");
    }

    /* Ask for answer, and check them. Number of chances includes
     * first one, where user is asked for reply. */
    private void askForAnswer() {
        int answer = -1;
        if(type)
            answer = readInt("What is " + x + "+" + y + "?");
        else
            answer = readInt("What is " + x + "-" + y + "?");
        for(int i = 1; i &lt; CHANCES+1; i++) {
            if(answer != solution) {
                if(i == CHANCES) {
                    println("No. The answer is " + solution + ".");
                    break;
                }
                answer = readInt("That's incorrect - try a different answer: ");
            } else {
                println("That's the answer!");
                break;
            }
        }
        answered++;
    }

    /* Produces type and two numbers until they qualify. */
    private void produceNumbers() {
        produceType();
        produceFirst();
        produceSecond();
        if(type)
            while(x+y &gt;= MAX) {
                produceFirst();
                produceSecond();
            }
        else
            while(x-y &lt;= MIN) {
                produceFirst();
                produceSecond();
            }
         calculateSolution();
    }

    /* Calculates equation solution. */
    private void calculateSolution() {
        if(type) solution = x + y;
        else solution = x - y;
    }

    /* Type of the equation. True is from plus, false is for minus. */
    private void produceType() {
        type = rgen.nextBoolean();
    }

    /* Produces first number. */
    private void produceFirst() {
        x = rgen.nextInt(0, 20);
    }

    /* Produces second number. */
    private void produceSecond() {
        y = rgen.nextInt(0, 20);
    }

    /* Class variables for numbers and type of the equation. */
    private static boolean type;
    private static int x;
    private static int y;

    /* Class variables for equation solution. */
    private static int solution;

    /* Class variable counting number of answered equations,
     * so if it reaches number of provided questions, it ends */
    private static int answered = 0;

    /* Random generator constructor. */
    RandomGenerator rgen = new RandomGenerator();

}
</code></pre>
