Question 34 W Consider the following code segment. theList + [-2, -1, 0, 1, 2] countl + 0 count2 0) { countl + countl + 1 } ELSE { count2 count2 + 1 } } What are the values of count1 and count2 as a...


Question 34 W<br>Consider the following code segment.<br>theList + [-2, -1, 0, 1, 2]<br>countl + 0<br>count2 < 0<br>FOR EACH value IN theList<br>{<br>IF (value > 0)<br>{<br>countl + countl + 1<br>}<br>ELSE<br>{<br>count2 count2 + 1<br>}<br>}<br>What are the values of count1 and count2 as a result of executing the code segment?<br>A<br>countl<br>2, count2 = 2<br>В<br>countl<br>2, count2 = 3<br>countl<br>3, count2<br>= 2<br>D<br>countl<br>5, count2 = 0<br>

Extracted text: Question 34 W Consider the following code segment. theList + [-2, -1, 0, 1, 2] countl + 0 count2 < 0="" for="" each="" value="" in="" thelist="" {="" if="" (value=""> 0) { countl + countl + 1 } ELSE { count2 count2 + 1 } } What are the values of count1 and count2 as a result of executing the code segment? A countl 2, count2 = 2 В countl 2, count2 = 3 countl 3, count2 = 2 D countl 5, count2 = 0

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here