import java.util.Scanner;

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

		Scanner kb = new Scanner(System.in);

		System.out.print("Enter integer: ");
		int num1 = kb.nextInt();

		boolean isGt10 = false;

		if(num1 > 10) {
			isGt10 = true;
		}
		else {
			isGt10 = false;
		}

		// The one line below (using the ?: operator) is equivalent 
		// to the conditionals shown above

		isGt10 = (num1 > 10) ? true : false;
		System.out.printf("isGt10: %b\n", isGt10);
	
		// More examples
	
		String str = (num1 > 10) ? "num1 gt 10" : "num1 lte 10";
		System.out.printf("str: %s\n", str);

		int value = (num1 == 10) ? 10 : 0;
		System.out.printf("value: %d\n", value);		

		boolean tenOrTwenty = (num1 == 10 || num1 == 20) ? true : false;
		System.out.printf("tenOrTwenty: %b\n", tenOrTwenty);

		String isOdd = (num1 % 2 == 1) ? "yes" : "no";
		System.out.printf("isOdd: %s\n", isOdd);


		// Switch statement

		String op = "";
		if(num1 == 0) {
			op = "add";
		}
		else if( num1 == 1) {
			op = "delete";
		}
		else {
			op = "edit";
		}
		System.out.printf("op: %s\n\n", op);
	
		// The following switch statement is equivalent to the 
		// conditional code shown above

		switch(num1) {
			case 0:
				op = "add";
				break;	
			case 1:
				op = "delete";
				break;
			default:
				op = "edit";
		}
		System.out.printf("op: %s\n\n", op);

	}
}
