Construct a main class named Array Program that generates an array of 50-integers, all ranging from one to one hundred. The program should then prompt the user to enter an array index so the number in the array at that index can be found, but the user might not enter an integer. That would throw an Input Mismatch Exception. Take steps to scold the user and stop the program if this happens.
If the user does enter an integer, call a method named return Index Value to return the integer at the specified index in the array. This method will take the array and the desired index as arguments, but the index may be too big for the array. That would throw an Array Index Out Of Bounds Exception. Deal with that possible scenario in return Index Value.
The main method should print the integer at the specified index if no exceptions are thrown. Sample runs are shown below.
Run One
Enter index of array to display.
four
You must enter an integer for the index.
Program stopped.
Run Two
Enter index of array to display.
75
75 is too high.
Index must be 0-49.
Run Three
Enter index of array to display.
35
That index holds 26