Score:

image

Incorrect Answers:

#23: this one was a question that I did not spend any time on and I just skipped it. The algorithm uses a temporary variable insertItem to ensure that no values are overwritten during the sorting process. At the end of each pass, all original values will still be in the array, however, the order may be altered. Therefore, the answer is C.

#30: This one was another one I skipped; choice II will return the correct cost based on numBoxes. choice I will first see if the first boolean condition is true. If it is, it will compute the totalCost and skip the next if statement since it is nested in the else.choice III will compute the incorrect price for numBoxes greater than or equal to 5 and will compute totalCost as numBoxes * 5.00 all times. This is because if numBoxes is greater than or equal to 5, it is also greater than 0 and the first if statement will evaluate to true and skip over the else statements; therefore, it is B rather than C; it is choice III only, not choice II.

#13: I did not really understand the question posed here for some reason and I seem to have picked a diffrent answer. This would be the result if the code segment in the for loop was changed to numbers[k-1] = numbers[k-1] + 3. the answer to the question is actually A.

#17: I spent a decent amount of time on this question and still got it wrong somehow; the answer is D because C would be the answer if loop was initialized to 0 instead of 1.

#18: I din’t spend much time on this one but it seems easy; i must have misunderstood the question. This would be the result if the division used was floating point division instead of integer division and the result was cast to an int, as in (int)(404.0 / 10 * 10 + 1). The answer is D.

#11: This is an extremely easy answer and I seem to have skipped it; The reverse of “nono” is “onon”, since these two strings are not equal, the method will return false. the answer is E.