class Question {

    String text;
    String[] options;
    int indexOfSolution;
    
    public Question(String text) {
        this.text = text;
        options = new String[4];
    }
    
    public void addOption(String text, boolean isSolution) {
        for (int i = 0; i < options.length; i = i + 1) {
            if (options[i] == null) {
                options[i] = text;
                if (isSolution) {
                    indexOfSolution = i;
                }
                break;
            }
        }
    }
    
    public boolean isCorrect(int indexOfSelection) {
        return indexOfSolution == indexOfSelection;
    }
    
    public String toString() {
        String s = text + "\n";
        for (int i = 0; i < options.length; i = i + 1) {
            s = s + (i + 1) + ": " + options[i] + "\n";
        }
        return s;
    }
    
}