Question: Consider the following method, count, which is intended to traverse all the elements in the two - dimensional ( 2 D ) String array things
Consider the following method, count, which is intended to traverse all the elements in the twodimensional D String array things and return the total number of elements that contain at least one a
public static int countString things
int count ;
for int r ; r things.length; r
for int c ; c thingsrlength ; c
if thingsrcindexOfa
count;
return count;
For example, if things contains salad "soup"water "coffee" then countthings should return
The method does not always work as intended. For which of the following twodimensional array input values does count NOT work as intended?
Responses
lemonlime
lemonlime
tall "short"up "down"
tall "short"up "down"
rabbit "bird"cat "dog"gecko "turtle"
rabbit "bird"cat "dog"gecko "turtle"
scarf "gloves", "hat"shoes "shirt", "pants"
scarf "gloves", "hat"shoes "shirt", "pants"
math "english", "physics"golf "baseball", "soccer"
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
