Java Programming Reusable input method for an int. Create a method called getInt
ID: 3789847 • Letter: J
Question
Java Programming
Reusable input method for an int. Create a method called getInt. It has four parameters: Parameter 1 is a String, used for the input prompt (example: “Enter the number of items ordered”) Parameter 2 is a type of your choice indicating 4 different range checking options: 1.No range checking 2.Only a lower bound range checking (inclusive) 3.Only an upper bound range check (inclusive) 4.Both lower and upper bounds checked (inclusive) Parameters 3 and 4 are ints for the range lower and upper bounds, if used. The method should use a dialog input box to get the int with the prompt provided. It should use a loop, and a try -catch block, along with appropriate range checking, to ensure data validity. It then returns the int. The prompt should be modified to include an error message if either the try-catch or the range checking flags an incorrect entry