0
import java.util.Scanner;


public class Lab7 {

    /**
     * @param args
     */
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int counter = 0;
        String[] letters = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
        final int ROW;
        final int COL;

        System.out.println("Please enter the total number of rows: ");
        ROW = scan.nextInt();
        System.out.println("Please enter the total number of colums: ");
        COL = scan.nextInt();
        int [][] nums = new int [ROW][COL];


        for (int r = 0; r < ROW; r++){
            for (int c = 0; c < COL; c++){
                System.out.print(letters + " ");
            }
            System.out.println();
            counter++;
        }




    }

}

First I have to prompt the user for total rows and colums (which I have). Next, I'm trying to generate random, capital letters formatted in rows and colums, which I cant generate, its giving some weird error. Lastly, the user has to be able to more charts without restarting the program. Any help would be appreciated

3
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by stultuske
0

its giving some weird error

Java error mesages may look weird but they usually tell exactly what the problem is and exactly where it's happening. Please post the complete exact text of your errors and someone will help.

1

are you sure it's an error?
I see that you print your array, instead of just an element of it, that might be your problem.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.