Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started