Hi, worlds worst programmer here for another question. I'm trying to use counter loops to form an empty rectangle as the title states above. The problem is, is that I just don't understand the logic behind using the while and if/else to form the printed "*" to actually do that stuff. Here is the source code below.
This type of problem is easiest if you create two functions.
One function to draw the top or bottom border.
A second function to draw the intervening rows (left and right border only).
You might want to consider making your minimum square size 2.
A square of size 1 would be just a single asterisk and would require a special check to draw just one border of length one.
Call the function to print the top row for length n.
Call the function to print the left and right borders n-2 times.
Call the function to print the bottom border for length n.