i need to write a program to output an ascii art pattern.
the size of the pattern should change dynamically based on class constants.  if i change the class constants, the pattern changes.

Should look like this 
Number of boxes: 4
Width of boxes: 6
Height of boxes: 3
+------+------+------+------+
|      |      |      |      |
|      |      |      |      |
|      |      |      |      |
+------+------+------+------+


public class testing{
    public static void main(String args[])
    {

       for(int hight = 1; hight<=2; hight++ ){
            System.out.println("");
        for(int box = 1; box<=4; box++ ){
                System.out.print("+");
        //      System.out.print("|");

        for (int width = 1; width <= 6; width++){ 
                System.out.print("_");

}
 }
}
    }
}

Recommended Answers

All 2 Replies

Start by indenting your code properly and fixing the compile errors.

What is the structure that you have now?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.