Programmiertechnik_I/Aufgabe6.java
// print christmas tree of height n with stump in the middle
print christmas tree of height n with stump in the middle
print christmas tree of height n with stump in the middle
public void print8(int height) {
    int doubleHeight = 2 * height;
    for (int i = 0; i < doubleHeight; i++) {
      if (i % 2 == 0) {
        for (int j = 0; j < doubleHeight - i; j++) {
          if (j % 2 == 0)
            System.out.print(" ");
        }
        for (int j = 0; j <= i; j++) {
          System.out.print("*");
        }
        System.out.println();
      }
    }
    for (int i = 0; i < height; i++)
      System.out.print(" ");
    System.out.println("|");
  }
public void print8 ( int height ) { int doubleHeight = 2 * height ; for ( int i = 0 ; i < doubleHeight ; i ++ ) { if ( i % 2 == 0 ) { for ( int j = 0 ; j < doubleHeight - i ; j ++ ) { if ( j % 2 == 0 ) System . out . print ( " " ) ; } for ( int j = 0 ; j <= i ; j ++ ) { System . out . print ( "*" ) ; } System . out . println ( ) ; } } for ( int i = 0 ; i < height ; i ++ ) System . out . print ( " " ) ; System . out . println ( "|" ) ; }
print christmas tree of height n with stump in the middle
print christmas tree of height n with stump in the middle
// only odd lines // Spaces before // body * // print tree stump