/* Helene Martin, Garfield AP CS
	Demonstrates code reuse by changing loop bounds to reverse cone into tower.
	Demonstrates use of class constant for rescaling.
*/
// drawCone()
// 
// *********
//  *******
//   *****
//    ***
//     *

public class ComplexFigures {
	public static final int SIZE = 5;
	
	public static void main(String[] args) {
		drawCone();
		drawTower();
	}
	
	// using class constant
	public static void drawCone() {
		for(int i = 1; i <= SIZE; i++) {
			// draw line - 1 spaces
			for(int j = 1; j <= i - 1; j++) {
				System.out.print(" ");
			}
			// draw 11 - line * 2 stars
			for(int j = 1; j <= 2 * SIZE + 1 - i * 2; j++) {
				System.out.print("*");
			}
			System.out.println();
		}
	}
	
	// without class constant
	// notice that outer loop is simply reversed
	public static void drawTower() {
		for(int i = 5; i >= 1; i--) {
			// draw line - 1 spaces
			for(int j = 1; j <= i - 1; j++) {
				System.out.print(" ");
			}
			// draw 11 - line * 2 stars
			for(int j = 1; j <= 11 - i * 2; j++) {
				System.out.print("*");
			}
			System.out.println();
		}
	}

}
