Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
(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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

Students also viewed these Databases questions

Question

=+Where do you want to live and work?

Answered: 1 week ago

Question

=+1 Where are the best places in the world to live (and work)?

Answered: 1 week ago

Question

=+Are you interested in working on global teams?

Answered: 1 week ago