Link to test

Final Score: 43/50

Q8:

Why I got it wrong and why the correct answer is right: The value of j does not need to be between 0 and k. The procedure only works if j and k are valid list indices, so it is important to document that j and k are both between 1 and LENGTH(numList), inclusive.

Q14:

Why I got it wrong and why the correct answer is right: Correct. When numCorrect is 8, the condition numCorrect > 7 evaluates to true and the condition numCorrect ≥ 9 evaluates to false. Therefore “check minus” is displayed instead of the intended “check plus”.

Q34:

Why I got it wrong and why the correct answer is right: The code segment initially assigns an empty list to thirdList, but none of the lists are empty after the code segment is executed.

Q35:

Why I got it wrong and why the correct answer is right: he last line in this code segment sets maxPS to 50 regardless of the value of time.

Q36:

Why I got it wrong and why the correct answer is right: This would be the correct solution if i were initialized to 0 instead of 1. This code segment will generate the list [4, 6, 8, 10, 12, 14, 16, 18, 20, 22].

Q39:

Why I got it wrong and why the correct answer is right: While the list elements are strings, the indices of a list are typically nonnegative integers.

Q50:

Why I got it wrong and why the correct answer is right: This statement concatenates firstName and lastName and then assigns the first character of the result (which is the first character of firstName) to initials.