import java.util.Scanner;

class Feb14 {
	public static void main(String[] args) {
		
		Scanner kb = new Scanner(System.in);

		System.out.println("Enter 2 ints");
		int lowerBound = kb.nextInt();
		int upperBound = kb.nextInt();

		int i = lowerBound;
		while(i <= upperBound) {
			System.out.print(i + " ");
			i++;
			//i = i + 1;
		}
		System.out.println();

		// compute sum of numbers
		// between upperBound and lowerBound
		// inclusively

		int sum = 0;
		i = lowerBound;
	
		while(i	<= upperBound) {
			//sum = sum + i;
			sum += i;
			i++;
		}
		System.out.printf("sum: %d\n", sum);

		//compute mean average

		double count = upperBound - lowerBound + 1; 
		double mean = sum / count;

		System.out.printf("mean: %.1f\n", mean);	

		// menu system using while-loop

		int option = 1;
		while(option != 0) {
			System.out.println("1. add");
			System.out.println("2. subtract");
			System.out.println("0. exit");
			System.out.print("Enter choice: ");
			option = kb.nextInt();

			System.out.printf("while-loop option %d\n", option);	
		}

		// do-while loop
		// block is executed at least once

		option = 0;
		do {
			System.out.println("1. add");
			System.out.println("2. subtract");
			System.out.println("0. exit");
			System.out.print("Enter choice: ");
			option = kb.nextInt();

			System.out.printf("do-while option %d\n", option);	
		} while(option != 0);
		
	}
}
