
import java.util.Scanner;

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

		char c = 'A';
		int asciiValue = (int) c;
	
		System.out.println(asciiValue);

		Scanner kb = new Scanner(System.in);
		System.out.println("Enter character");


		// Compute sum of integers between 1 and 100;

		int sum = 0;
		int i = 1;  // initialize counting variable

		while(i <= 100) {      // testing the counting variable
			sum = sum + i;
			i++;		// incrementing the counting variable	
		}

		System.out.println("sum: " + sum);

		/* for-loop that does the same thing. */

		sum = 0;
		for(int j = 1; j <= 100; j++) {
			sum = sum + j;
		}

		System.out.println("sum: " + sum);

		/*
		for(;;) {   // infinite loop
			;
		}
		*/

		sum = 0;
		for(int k = 1; k <= 100;  ) {
			sum = sum + k;
			k++;
		}

		/* break and continue */

		sum = 0;
		i = 1;
		while( i <= 100) {
			sum = sum + i;
			if (sum > 2000) {
				System.out.println(sum);
				break;  // breaks out of loop
			}
			i++;
		}	
		

		sum = 0;
		i = 1;
		while( i <= 100) {
			sum = sum + i;
			if (sum > 2000) {
				System.out.println(sum);
				i = 101;
				continue;
			}
			i++;
		}	

		System.out.println(sum);

		/* do-while loop */

		int input = 0;

		do {
			System.out.println("Please enter an int, 0 to end");
			input = kb.nextInt();
			System.out.println("Thank you");

		} while(input != 0);


		int x = 1;
		char y = '1';

		int yAsciiValue = (int) y;

		System.out.println(yAsciiValue);

		if (x == y) {
			System.out.println("equal");
		}

		System.out.printf("%d, %d\n", x, (int)y); 

		if(x == Character.getNumericValue(y)) {
			System.out.println("equal");
		}

	}
} // End of class
