/* Make a menu driven program that will allow the user
 * to do the following options:

   1. enter 10 elements into an array of 10 elements
   2. display the elements
   3. find the smallest value in the array
*/
import java.io.*;
public class Ex_5_2_1_9 {
	
	public static void main (String[] args) throws Exception {
		int x[] = new int[10];
		String choice = "";
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader keyboard = new BufferedReader(isr);
		do {
			// display menu
			System.out.println ("Main Menu");
			System.out.println ("(E)nter elements");
			System.out.println ("(D)isplay elements");
			System.out.println ("(S)mallest value");
			System.out.println ("(Q)uit");
			
			// get choice
			System.out.print("Enter choice (E/D/S/Q): ");
			choice = keyboard.readLine();
			
			// if statement to take care of choices
			if (choice.equalsIgnoreCase("E")) {
			/* enter code to have user enter in values for array:
			 * Enter element 0: __ (it is typed in...)
			 * Enter element 1: __ etc.
			*/
					
			} else if (choice.equalsIgnoreCase("D")){
			/* enter code to display all of the values
			 * in a table format:
			 * Element		Value
			 * ~~~~~~~		~~~~~
			 * 0			24
			 * 1			-23
			 * etc.
			*/
			} else if (choice.equalsIgnoreCase("S")){
			/* enter in code to find the smallest value in
			 * the array
			 * you will need to use a loop to look at all the values
			 * AND an if to find the smallest value
			 * then print out the smallest value:
			 * System.out.println("The smallest value is " + small);	
			*/
						
			}
		} while (!choice.equalsIgnoreCase("Q"));
		
	}
}