can u just give me some hints Please
Watch closely because the following is much more than a hint; it's a complete
giveaway:
-
private static boolean isStar(int x, int y) { return true; }
-
-
private static void square(int N) {
-
for (int x= 0; x < N; x++) {
-
for (int y= 0; y < N; y++)
-
System.out.print(isStar(x, y)?'*' : ' ');
-
System.out.println();
-
}
-
}
-
The isStar() method returns true when at a certain position x, y a star should be
printed; otherwise it returns false. My implementation is a dummy implementation.
The square() method prints a square of size N. It consults the isStar() method for
every position x,y whether or not it should print a star or a space.
Now all you have to do is come up with a correct implementation of the isStar()
method.
kind regards,
Jos