Question: (ArrayIndexOutOfBoundsException) Write a program that meets the following requirements: Creates an array with 100 randomly chosen integers. Prompts the user to enter the index of
(ArrayIndexOutOfBoundsException) Write a program that meets the following requirements: Creates an array with 100 randomly chosen integers. Prompts the user to enter the index of the array, then displays the corresponding element value. If the specified index is out of bounds, display the message Out of Bounds.
Following modifications:
* Use either a Scanner object or JOptionPane.showInputDialog() for input.
* Use either System.out.println() or JOptionPane.showMessageDialog() for output.
* In addition to ArrayIndexOutOfBoundsException, also catch InputMismatchException or NumberFormatException, and Exception.
This assignment is completed by writing a single application (.java file) with a main() method that includes all the elements
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
