In this situation, well use exception handling for input validation, which in turn, helps to ensure that were writing more robust and more fault-tolerant programs.
Ok, so the idea here is that were attempting to write a program that allows a user to input integer values into a 10-element array and, in addition, will also allow the searching of the array. This program should allow the user to retrieve values from the array by index or by specifying a value to locate. The program should handle any exceptions that might arise when inputting values or accessing array elements. The program should throw a NumberNotFoundException if a particular value cannot be found in the array during a search. If an attempt is made to access an element outside the array bounds, catch the ArrayIndexOutOfBoundsException and display an appropriate error message. Also, the program should throw an Array-IndexOutOfBoundsException if an attempt is made to access an element for which the user has not yet input a value.
Using the helpful hints as a guide, replace the /* */ comments with Java code. Compile and execute the program. Compare your output with the sample output provided.
Acceptance Criteria: 1. Output is reflective of the sample output provided.
Sample output: See image.