import java.util.Scanner;
public class Test {
public static void main(String[] args) {
try (Scanner tru = new Scanner(System.in)) {
int number;
System.out.println("Please enter number");
number = tru.nextInt();
for (int i = 0; i <= number; i++ ) {
for (int j = 0; j <= number; j++) {
if (j % 2 ==0) {
System.out.print("+++");
} else {
System.out.print("***");
}
}
System.out.println(" ");
}
}
}
}
Please enter number
5
+++***+++***+++***
+++***+++***+++***
+++***+++***+++***
+++***+++***+++***
+++***+++***+++***
+++***+++***+++***
import java.util.Scanner;
public class Tests {
public static void main(String[] args) {
try (Scanner tru = new Scanner(System.in)) {
int number;
System.out.println("Please enter number");
number = tru.nextInt();
for (int i = 1; i <= number; i++) {
if (i % 2 == 0) {
System.out.print("***");
} else {
System.out.print("+++");
}
}
System.out.println(" ");
}
}
}
Please enter number
5
+++***+++***+++