OK, I have this example to program:
I know I need to use a set of for-loops, but I just cannot get the algorithm down that I need. This is supposed to be horribly simple, but it is driving me out of my mind.
That is what I have come up with so far...
Code:
...#... ..###.. ...#...
Code:
public class Carpet
{
public static void main (String args[])
{
int breite = 7;
int hoehe = 3;
for (int h = 1 ; h <= hoehe ; h++)
{
for (int i = 1 ; i <= breite-1 ; i++)
{
System.out.print(".");
if (i == 3)
System.out.print("#");
}//end for i
System.out.println();
}//end for h
}//end method main
}//end class Carpet