
import java.util.Scanner;

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

		Scanner kb = new Scanner(System.in);
	
		String option = null;

	    // We can implement a menu system using if-else-if statements
		do {
			printMenu();
			option = kb.nextLine();
		
			if (option.equals("add")) {
				// do add thing
			}
			else if (option.equals("remove")) {
				// do remove thing
			}
			else if (option.equals("list")) {
				// do list thing
			}
			else if (option.equals("exit")) {
				// do nothing
			}
			else {
				// invalid choice
			}

            // Alternatively, we can use an equivalent switch statement
			switch(option) {   // option can be string, int, or char
				case "add":
					// do add thing
					break;
				case "remove":
					// do remove thing
					break;
				case "list":
					// do list thing
					break;
				case "exit":
					// do nothing
					break;
				default:
					// invalid choice
			}

            // By omitting break statements, multiple options can use the same
            // block of code
			switch(option) {
				case "add":
				case "plus":
					// do add thing
					break;
			}

            // use "" for String cases, '' for char cases, and integer expressions for
            // integer cases
			char opt = kb.nextLine().charAt(0);
			switch(opt) {
				case 'a':
					// do a thing
					break;

				// etc
			}

			final int x = 1 + 2;
			int choice = kb.nextInt();

			switch(choice) {
				case (x):
					// do one thing
					break;
				// etc
			}

			switch (choice % 2) {
				case 0:
					// do 0 case
					break;
				case 1:
					// do 1 case
					break;
			}

            // experimenting with booleans
			boolean flag = false;
			String x1 = String.valueOf(1 != 4);
			System.out.println("flag: " + flag);
			System.out.println("x1: " + x1);
		
		}while(!option.equals("exit"));



	}

	static void printMenu() {
		System.out.println("add - add element");
		System.out.println("remove - remove element");
		System.out.println("list - list all elements");
		System.out.println("exit - terminate program");
		System.out.print("Enter choice: ");
	}
}
