I'm trying to make it so that when the user enters anything but `y`/`n` it'll say error and when they enter `n` it'll say have a great day. This is what I have so far, but I keep running into trouble. 

This is the assignment: 

> 
> Write a program that gets an integer from the user, say x, and then
>  prints an x by x square, and it prints that square x number of times.
>  For example, if the user enters 4, your program will print a 4x4
>  square four distinct times. Specifics:
> 
> 
> The user enters a value 3-15. Input validation: only accept 3-15.
>  Allow the user to repeat the program if desired. Input validation: Y
>  or N only, but also allow lowercase entries.
> 
> 
> 

```
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner keyboard = new Scanner(System.in);
        System.out.println("*******************************************************\n"
                + "*******************SQUARE GENERATOR********************\n"
                + "*******************************************************\n"
                + "\nThis program will let you enter an integer between\n"
                + "3-15 and print out that many squares of that dimension.\n");

        char answer = 'y';
        while (answer == 'y' || answer == 'Y') {
            System.out.println("Enter the square size --> ");
            int x = keyboard.nextInt();
            while (x < 3 || x > 15) {
                System.out.println("Error: Select a number between 3 and 15 inclusive: ");
                x = keyboard.nextInt();
            }
            for (int i = 0; i < x; i++) {
                for (int j = 0; j < x; j++) {
                    for (int k = 0; k < x; k++) {
                        System.out.print("X");
                    }
                    System.out.println("");
                }
                System.out.println("");
            }
            System.out.println("Would you like to try again Y/N? --> ");
            answer = keyboard.next().charAt(0);
        }
        answer = 'n';
        while (answer == 'n' || answer == 'N') {
            System.out.println("Program ending. Have a great day.");
        }
        keyboard.close();
    }
}

```