/**
 * Personal Library Manager.
 *
 * @author	Terry Sergeant
 * @version Spring 2015
 *
 * <pre>
 * This version implements the menu and is intended to be starter code
 * for the case study.
 * </pre>
 */

import java.util.Scanner;

public class PersonalLibrary
{
	public static void main(String [] args)
	{
		int choice;						 // user's selection from the menu

		do {
			choice= menuChoice();
		} while (choice!=0);

		System.out.println("\nTHE END");
	}


	/**
	 * Displays menu and get's user's selection
	 *
	 * @return the user's menu selection
	 */
	public static int menuChoice()
	{
		Scanner kb= new Scanner(System.in);
		int choice;	 // user's selection

		System.out.println("\n\n");
		System.out.print("------------------------------------\n");
		System.out.print("[1] Add a Book\n");
		System.out.print("[2] Delete a Book\n");
		System.out.print("[3] List All Books\n");
		System.out.print("[4] Search by Author\n");
		System.out.print("[5] Search by Title\n");
		System.out.print("[6] Search by Number of Pages\n");
		System.out.print("---\n");
		System.out.print("[0] Exit Program\n");
		System.out.print("------------------------------------\n");
		do {
			System.out.print("Your choice: ");
			choice= kb.nextInt();
		} while (choice < 0 || choice > 5);

		return choice;
	}

}
