title: Rectangular printer prgram
body: <ol>
  <li><p>Prompt the user for the height and width of a rectangle that will be displayed as rows and columns of asterisk (*) characters.</p></li>
  <li><p>Using your knowledge of loops, generate the rectangle output. The height will be the number of rows and the width will be the number of characters in each row. Since your output will be generated one row at a time, make sure you complete each row before moving on to the next.</p></li>
  <li><p>Modify your program so that it generates only the outside border of a rectangle rather than a filled rectangle.</p></li>
  </ol>
  
  <p>I dont know how to get the asterisks to line up in rows and columns.</p>
  
  <pre><code>import java.util.Scanner;
  public class Main {
      public static void main(String[] args) {
  
          int width;
          int height;     
  
          Scanner input = new Scanner(System.in); 
  
          System.out.print("Enter the width:");
          width = input.nextInt();
          System.out.print("Enter the height:");
          height = input.nextInt();
          int y = 0;
          for (int x = 0; x &lt;= width; x++){
              System.out.println("*");
              while (y &lt;= height){
                  y++;
                  System.out.println("*");
              }
          }
      }
  }
  </code></pre>
  
  <p>I am trying to get an output that looks something like this for width = 4 height = 4</p>
  
  <pre><code>****    ****
  ****    *  *
  ****    *  *
  **** or ****
  </code></pre>