contains() General Cases
It is important to test the general cases of the contains() method.
If all preconditions are met, then either the element x
is found, or it is not. We need to test these cases.
We also need to test 'edge cases' for x (if they are equal to the minVal
or maxVal
.
Objective 3 for this lab
Implement the following test cases for the contains() method at this location in main().
We must test for general and edge values of x
NOTE: Your test cases must print "true" or "false" depending on whether the value is found
NOTE: You might discover a bug in the contains() function. If you find a bug, you must fix the bug.
case 9: { // 9: contains(x), where 'x' is found // INSERT CODE HERE } break; case 10: { // 10: contains(x), where 'x' is not found // INSERT CODE HERE } break; case 11: { // 11: contains(x), where 'x' equal to 'minVal' // INSERT CODE HERE } break; case 12: { // 12: contains(x), where x equal to 'maxVal' // INSERT CODE HERE } break;