import java.util.Scanner;

public class ForLoops {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		
		// for loops
		// 1. start
		// 2. condition
		// 3. next
		// 4. repeat
		
		// for (start; condition; next) {
		//   repeat
		// }
		
		int count;
		for(count = 0; count < 10; count++) {
			//int i = 3;
			System.out.println(count);
		}
		//count was only declared within the for loop, now it isn't
		System.out.println(count);
		
		for(char c = 'A'; c <= 'Z'; c++) {
			System.out.print(c);
		}
		System.out.println();  //new line after Z
		
		System.out.println("Enter an integer: ");
		int value = input.nextInt();
		
		//table heading
		System.out.printf("%10s |%10s |%10s |%10s\n", "i", "i^2", "i^3", "2^i");
		
		for(int i = 0; i < 46; i++) {
			System.out.print("-");
		}
		System.out.println();
		
		for(int i = 0; i <= value; i++) {
			//leave 10 spaces for each
			System.out.printf("%10d |%10d |%10d |%10.0f\n", i, i*i, i*i*i, Math.pow(2, i));
		}
		
	}

}
