Part of homework is to think about ALL that you have learned so far.
You alread know HOW to print 1 line of Symbols. Which means you can also do 2 lines. The only tricky part you are currently facing is how to tell the computer to print one star THEN print some spaces THEN print the last star (aka Symbol).
I can see the answer was already provided. But keep in mind that you will need to reduce the "Width" by 2 for the First and Last "Symbol" of the hollow areas; and "Height" by 2 for First and Last rows. I'm sure your teacher will take points off if you don't. Consider the following display:
[visual example]
height = 4; Width = 10
********** (10 stars)
*........* (2 stars + 8 spaces/dots = 10 chrs on the line)
*........* (2 stars + 8 spaces/dots = 10 chrs on the line)
********** (10 stars)
The best thing to do when you are stuck is write out pseudo code so you can have a better understanding of what you want the computer to do -- note: it doesn't have to be good programming it just has to have a flow you (and others) can understand.
[pseudo code - not code but theory of How you want it to work]
h=10; w=10
neww=w-2 (New width = original width - 2 [first & last chrs])
newh=h-2 (New height = original height - 2 [first & Last rows are solid])
/*main body*/
Print 1 line of Syms (takes care of the First row of stars)
/*hollow section*/
While count1 <= newH
....Print only 1 Sym (the first char of line)
.........While count2 <= newW
............Print Dots (the "hollow" area)
.........End of count2
....Print only 1 Sym (only prints Last char of line)
End of count1
/*end of Hollow Section*/
Print 1 line of Symbols (Takes care of the Last row of stars)
/*end of main body*/
See? In theory, it is do-able without IF statements. Hopefully, you will come up with something on your own instead of simply being given the answer. Yes, it's ironic in this place but remember the old saying:
"If you give a man a fish, he'll eat for today; But, if you teach a man to fish, he'll eat for a life time."
Good luck with your assignment.
--JA