Writing a nested loop with a single for loop (generic) - java
<p>No one in my residence hall knows how to do this question on our CS homework. It says:</p>

<p>The nested loops</p>

<pre><code>for(int i = 1; i &lt;= height; i++)
{
   for(int j = 1; j &lt;= width; j++)
   {
      System.out.print("*");
   }
   System.out.println();
}
</code></pre>

<p>displays a rectangle of a given width and height, such as</p>

<pre><code> ****
 ****
 ****
</code></pre>

<p>for a width of 4 and a height of 3.  Write a single for loop
    that displays the same rectangle.  Remember that 3 and 4 are only
    an example, and your code must be general and work for any width
    and height.</p>

<p>We have tried many things but each one ends in failure. Are we missing something obvious?</p>
