Ask your own question, for FREE!
Computer Science 17 Online
SourMunchkin7806:

Which is an inappropriate use of a for-each loop? when all values in an array need to be traversed when values need to be assigned to an array when an index variable is required to complete a task

Ultrilliam:

Which do you think it is?

SourMunchkin7806:

I have 2 and 3

SourMunchkin7806:

Oh wait

Ultrilliam:

LOL

SourMunchkin7806:

I only II only III only II and III only I, II, and III

SourMunchkin7806:

There are the options

Ultrilliam:

Had me confused for a sec there

SourMunchkin7806:

Lol judging by the "lol" im wrong

Ultrilliam:

Either it's 1, or all 3. Leaning to all 3... hm

SourMunchkin7806:

Ok ill go with what you think aha

SourMunchkin7806:

In reference to for-each loops, which of the following statements is true? for-each loops can be rewritten as for loops an index variable is NOT explicitly coded an ArrayIndexOutOfBoundsException will always be thrown I and II only I and III only II and III only I, II, and III None of the statements are true

SourMunchkin7806:

Can you just check that one i have 1 and 2 only put

Ultrilliam:

That seems about right

SourMunchkin7806:

Yus ok im gonna submit it lets see

Ultrilliam:

WAIT

SourMunchkin7806:

?

Ultrilliam:

I just realized it said what is an INAPPROPRIATE use to use for-each, I thought it said appropriate LOl

SourMunchkin7806:

Lollll So what is it

Ultrilliam:

That makes so much more sense, and you were right LOL

SourMunchkin7806:

So go with 1 and 2?

Ultrilliam:

Yep

SourMunchkin7806:

Ok whale do Thanks man!

Ultrilliam:

No problemo!

SourMunchkin7806:

I got a 60 lol

Ultrilliam:

1548180198-5c47582718c6060f0f521100-image.png

Ultrilliam:

What was wrong?

SourMunchkin7806:

The one about the innapropriate for-each loop and the all three print the same one

Ultrilliam:

It was 2 and 3 only then, and probably 2 only, been a while since I touched C, rip

SourMunchkin7806:

Oh whale ahaha still i passed thanks man

Ultrilliam:

No problem, sorry about that x-x

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!