Question: I'm supposed to create an asterisk box with an X inside of it using an input for how many specified rows. 
Example if size = 7
Output:

```
*******
**   **
* * * *
*  *  *
* * * *
**   **
*******

```

So far I've been able to find out how to create an empty hollow box.

```
// n is size of box, r = rows, c = columns
for (int r = 1; r <= n; r++) {
    for (int c = 1; c <= n; c++) {
        if (r == 1 || r == n || c == 1 || c == n) {
            System.out.print("*");
        } else {
            System.out.print(" ");
            System.out.println();
        }
    }
}

```

Other than that I am unsure of how to get the correct spacing and asterisk placement to place the X inside of the box. Any help would be greatly appreciated. :)

Answer: 
Think about it matematically.

The X is the diagonal and the reverse diagonal.

* So, anytime X is equal to Y, add an asterisk.
* Also, anytime X is equal to HEIGHT - Y, add an asterisk.

This will work only for square boxes.

Hope this helps!
What @ZektorH said in code:

```
  int sizeOfBox = 11;
  int row = 1;
  for (; row <= sizeOfBox; row++) {
     if (row != 1) {
        System.out.println();
     }
     for (int column = 1; column <= sizeOfBox; column++) {
        if (column == 1 || column == sizeOfBox || row == 1 || row == sizeOfBox) {
           System.out.print("*");
        } else {
           if (column == row || column == (sizeOfBox-row+1)) {
              System.out.print("*");
           } else
              System.out.print(" ");
        }

     }
  }

```