// Name : Matthew Reeves // This program accepts menu choices as an array then // displays the menu to the screen and takes user inputs package MenuPkg; import java.util.Scanner; import java.util.InputMismatchException; //this creates the class that displays the menu options, then //reads and validates the user's entries for menu selection public class Menu { private String options[]; //gets the string array containing menu options from a test file //sets the values in that array to a new array that can be manipulated //in the menu class public Menu(String opts[]) { options=new String[opts.length]; for (int count=0;count=options.length) { System.out.println("I'm sorry, please enter appropriate numeral values only.\n"); continue; } else { continueLoop=false; } } catch (InputMismatchException inputMismatchException) { System.err.printf("\nException: %s\n",inputMismatchException); System.out.println("\nI'm sorry, please enter appropriate numeral values only.\n"); input.nextLine(); } }while (continueLoop); return choice; } }