I am working on some homework for one of my classes and got a problem that I am having some trouble with. I can't quite figure out how I would do it. If somebody could point me in the right direction as to how I would go about it that would be great. Here is the question.
The nested loops
for (int i = 1; i <= height; i++)
{
for (int j = 1; j <= width; j++) { System.out.print("*"); }
System.out.println();
}
display a rectangle of a given width and height, such as
**** **** ****
Write a single for loop that displays the same rectangle.