Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

List two boundary conditions that should be checked when testing method readInt

ID: 3756053 • Letter: L

Question

List two boundary conditions that should be checked when testing method readInt below. The second and third parameters represent the upper and lower bounds for a range of valid integers. Returns an integer data value within range minN and maxN inclusive *@param scan a Scanner object *@param minN smallest possible value to return *@param maxN Targest possible value to return *@return the first valueread between minN and maxN public static int readInt (Scanner scan, int minN, int maxN) if (minN > maxN) throw new IllegalArgumentException ("In readlnt, minN"minN boolean inRangefalse; // Assume no valid number read int n=0 while C!inRange) t // Repeat until valid number read. System.out.println("Enter an integer from"minN " to" + maxN + ": "); try n -scan.nextlntO; catch (InputMismatchException ex) 1t scan.nextLineO System.out.println("not an integer - try again"); /End while return n; // n is in range

Explanation / Answer

please do upvote.If you have any problem do comment and i shall be happy to help you.Thanks for using chegg.

--------------------

boundary conditions---------->conditions that lie on the border of a range

in our case the value must be in range minN to maxN inclusive

find the values that sit on the border of range

so following are two boundary conditions that can be checked while testing readInt:

minN

maxN

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote