1. import java.util.Scanner;
  2. 
  3. /**
  4. * Lab4.java
  5. * @author Jose M Vidal <jmvidal@gmail.com>
  6. * Created on Jan 30, 2012
  7. *
  8. */
  9. 
  10. public class Lab4 {
  11. 
  12. /**
  13. * @param args
  14. */
  15. public static void main(String[] args) {
  16. Scanner keyboard = new Scanner(System.in);
  17. System.out.print("Enter size of grid (1--10):");
  18. int size = keyboard.nextInt();
  19. System.out.print(" ");
  20. for (int col = 1; col <= size; col++){
  21. System.out.print(col + " ");
  22. }
  23. System.out.println("");
  24. for (int row = 0; row < size ; row++) {
  25. System.out.print((char)('A' + row));
  26. System.out.print(" ");
  27. for (int col = 0; col < size; col++) {
  28. System.out.print("o ");
  29. }
  30. System.out.println("");
  31. }
  32. 
  33. 
  34. }
  35. 
  36. }