Question
For Java Write a Program that Meets the Following Requirements Calls a method that creates an Array with 100 Random Generated Integers Calls a method
For Java
Write a Program that Meets the Following Requirements
Calls a method that creates an Array with 100 Random Generated Integers
Calls a method that writes the elements of the array to a text file inside the Project Folder of the assignment. Relative File Addressing must be used. not absolute file addressing. This method should have appropriate IO Exception handling.
Calls a method that prompts the user to enter an index position of the array and returns the value of the array element at the entered index position. If the value entered by the user is not a valid integer, throw an" Input Mismatch Exception" that prompts the user of the problem and permits them the opportunity to input a correct integer or exit the program
When a valid integer value is entered, calls a method that receives the value that the user entered as an index position in the array. The method will display the corresponding value in the index position of the value entered. If the value entered by the user is outside of a valid index position in the array, throw an" Array Index Out Of Bounds Exception"
All exceptions should be detected in their associated methods and handled in the main method
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started