Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
(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
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