I'm attempting to get spaces at the beginning of every other line of the output of this program:
import java.util.Scanner;
public class Checkerboard
{
public static void main(String[] args)
{
int num;
Scanner input = new Scanner(System.in);
System.out.println ("What is the integer?");
num = input.nextInt();
for (int x = 0; x < num; x++)
{
for (int y = 0; y < num; y++)
{
System.out.print("A ");
}
System.out.println(" ");
}
}
}
The output of this program, if the user enters "4" for example, is:
A A A A A
A A A A A
A A A A A
A A A A A
I'm trying to get it to look like this:
A A A A A
(space)A A A A A
A A A A A
(space) A A A A A