Nested Loops: Hollow Squares, Logical operators

The goal for this exercise is to make sure that you can use nested loops.

What you need to do to prepare for this exercise:


What you need to do for this exercise

In the starter project, fill in the Nested_Loops_Hollow_Rectangles.RunExercise method, so that it will print out a hollow rectangle. The user should be prompted to enter the size of the sides of the rectangle. Within your nested loops, you should use a single if…else statement in order to figure what to print. This requirement is here to force you to use logical operators – feel free to get your program working however you can, then change it (after making a back-up copy!! ) so it uses the single if…else before you hand it in.

An example transcript of what your program might look like follows. User input looks like this.

Welcome to HollowRectanglePrinter!
How many columns wide should the rectangle be? 6
How many rows tall should the rectangle be? 4
Here you go:
******
*    *
*    *
******