Designing your own user interface and algorithms/code

 Step 1: Do the 1st line of n * 

              Step 1.a  Using a for loop, print the n * one at a time.
              Step 1.b  Advance to a new line by using print without ;
 Step 2: Do the n - 2 inner lines 

 Step 2 restated:

         For each line of the n - 2 "inner lines" do following
                print (produce) one of the inner lines 
                            (not the top, not the bottom) of the rectangle
         Next line

 Step 3: Do the last line of n *     
 Step 2 restated again to show details of what happens in the loop 

      For each line of the n - 2 lines do 
           2.a  Print the 1st * (the left edge * for an inner row)
           2.b  Print the n - 2 spaces that are inside or between *          
           2.c  Print the last or closing or right edge * 
           2.d  Advance to the next line

      Next line

  How do you do step 2.b above?  How can you print n - 2 spaces?

  It is another loop, nested within the For each line loop.

Triangles and Rectangles program hints and discussion of how Top Down Development and StepWise refinement and Ghostbusters VET SAT AUC and TVV SO YMDC fit in with the current task.

Your program will provide the following capabilities: