Question: The following method is designed to return true if the passed phrase contains either the word cat or dog. public boolean containsPet ( String input
The following method is designed to return true if the passed phrase contains either the word cat or dog.
public boolean containsPetString input
if inputindexOfcat
return true;
else if inputindexOfdog
return true;
else
return false;
Which of the following test cases can be used to show the code does NOT work as intended?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
