Question: Write a method: that displays the prompt string, reads an integer, and tests whether it is between the minimum and maxi mum. If not, print
Write a method:
![]()
that displays the prompt string, reads an integer, and tests whether it is between the minimum and maxi mum. If not, print an error message and repeat reading the input.
Add the method to a class Input.
••
public static int readInt( Scanner in, String prompt, String error, int min, int max)
Step by Step Solution
3.27 Rating (153 Votes )
There are 3 Steps involved in it
It seems you want to write a Java method within a class named Input ... View full answer
Get step-by-step solutions from verified subject matter experts
