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),

in java
in java (d) (10 points) Write a method which takes in a

(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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!