import java.io.*;

public class MenuExample
{
	public static void main(String [] args) throws IOException
	{
		//declare input stream
		BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
		String choice = "";
		
		System.out.println("WELCOME TO THE DATABASE PROGRAM!");
		
		while (!choice.equals("q"))
		{			
			//print menu
			printMainMenu();
			
			//prompt user for what they want to do
			System.out.print("What would you like to do? ");
			choice = stdin.readLine();
	
			if (choice.equals("a") || choice.equals("A"))
			{
				System.out.println("You chose to add!");
				subMenuAdd();
			}
			else if (choice.equals("f") || choice.equals("F"))
			{
				System.out.println("You chose to find!");
				subMenuFind();
			}
			else if (choice.equals("r") || choice.equals("R"))
			{
				System.out.println("You chose to remove!");	
			}
			else if (choice.equals("p") || choice.equals("P"))
			{
				System.out.println("You chose to print!");	
			}
			else  
			{
				if (!choice.equals("q"))
					System.out.println("INVALID COMMAND!");
			}
		}
	}
	
	public static void printMainMenu()
	{
		System.out.println();
		System.out.println("(a)dd to the database");
		System.out.println("(f)ind in the database");
		System.out.println("(r)emove from the database");
		System.out.println("(p)rint the database");
		System.out.println("(q)uit the program");
		System.out.println();
	}
	
	public static void subMenuAdd()
	{
		//here is where you do all the menus and prompts to add
	}
	
	public static void subMenuFind()
	{
		//here is where you do all the menus and prompts to find
	}
}
