title: Draw A Rectangle With Asterisks
body: <p>I am trying to write a C++ Program to display a rectangle drawn in asterisks. I have the program running properly except for the fact that only one side of the heights of my rectangles print. Here is the code I have currently written for the display rectangle method.</p>
  
  <pre><code>void Rectangle::displayRectangle()
  {
      int i=0, j=0;
      for (int i = 0; i &lt; width; i++)
      {
          cout &lt;&lt; "*";
      }
      cout &lt;&lt; endl;
      for (int i = 0; i &lt; height - 2; i++)
      {
          cout &lt;&lt; "*";
          for (int j = 0; j &lt; width; j++)
          {
              cout &lt;&lt; " ";
          }
          cout &lt;&lt; endl;
      }
      for (int i = 0; i &lt; width; i++)
      {
          cout &lt;&lt; "*";
      }
      cout &lt;&lt; endl;
  }
  </code></pre>