Question: in java (d) (10 points) Write a method which takes in a Scanner as a parameter, and two integers (a lower bound and upper bound),
(d) (10 points) Write a method which takes in a Scanner as a parameter, and two integers (a lower bound and upper bound), asks the user to input in an integer between the lower and upper bound, and then returns the integer that the user inputs. If they input something that is not an integer, output an error message and ask the user to try again. If they input something out of the range (lower bound - upper bound), output an error message and ask the user to try again. If they input something that is in the correct range, return that integer. public static int getinput(Scanner sc, int lower, int upper) \{
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
