| preferred AP College board partner for AP classes
easy Solved by 2 students
List Iteration with a Condition
< Prev
Next >

In a content management system, a feature is needed to count the number of articles that are longer than 500 words. Given a list of article word counts, which of the following loops correctly implements this feature?

A

for (wordCount > 500 in articleWordCounts) { count++; }

B

for each (wordCount in articleWordCounts) { if (wordCount > 500) count++; }

C

foreach wordCount in articleWordCounts { if (wordCount > 500) count++; }

D

for each wordCount > 500 in articleWordCounts { count++; }

Check Answer
APFIVE © 2020.
Email: [email protected]|Privacy Policy