Draws a Xmas tree on the screen of using size : I've been trying draw a Xmas tree by using size which is input from user and I also have been trying to find out the logic such as spaces would it take. Any hint for me would be fantastic. Also, this lab requires only one "for" loop and have to call the method write-pattern which I provide below. Thank you so much.
Sorry if the code was too long. It's just to make sure that you guys can understand it.

    for (int i=0; i <=size; i++) {
            writePattern (' ','*',' ', ' ',' ',size -i,i,0,0,0,size+2);
            writePattern (' ','*','*',' ',' ',size -i,i,i,0,0,size+2);
        }
 



This is the wrirePattern that I mentioned above.

    private void writePattern(char ch1, char ch2, char ch3, char ch4, char ch5, int n1, int n2, int n3, int n4, int n5, int length)  
{
     
    while ((n1 > 0) && (length > 0)) {
        System.out.print(ch1);
        n1--;
        length--;
         }

     while ((n2 > 0) && (length > 0)) {
        System.out.print(ch2);
        n2--;
        length--;
     }

     while ((n3 > 0) && (length > 0)) {
        System.out.print(ch3);
        n3--;
        length--;
     }

     while ((n4 > 0) && (length > 0)) {
        System.out.print(ch4);
        n4--;
        length--;
     }

     while ((n5 > 0) && (length > 0)) {
        System.out.print(ch5);
        n5--;
        length--;
    }

    System.out.println();   
    }

This is from another class which uses to give the output:

`drawer.drawXmasTree();
            System.out.println("\n");`;

 