MCQ Test #4

Corrections

Q26

Incorrect Answer: B

Correction: D, “Regardless of the compression technique used, once a data file is compressed, it cannot be restored to its original state” would be a false statement since it is known that lossless compression allows for the data to be returned to its original state. The correct answer would be that there are trade-offs when it comes to the technique used depending onwhether one chooses lossless or lossy.

Topics to watch videos on: 2.3, skill 5B

Q39

Incorrect Answer: A

Correction: D, The first number displayed must be 1. The second number displayed could be 1 or 2. The third number displayed could be 1, 2, or 3. The last number displayed could be 1, 2, 3, or 4. So 1111 is a possible output. In the second iteration of the loop, i is equal to 2. Thus RANDOM(1, i) returns either 1 or 2. So, the output 1324 is not possible.

Topics to watch videos on: 3.15, skill 4B

Q40

Incorrect Answer: C

Correction: D, I had assumed it would be a range, so I chose the least and greatest possible results of RANDOM. The possible values of ans are between the sum of the least possible results of the RANDOM calls and the sum of the greatest possible results of the RANDOM calls, not the least and greatest possible results of the last RANDOM call. The first call to RANDOM returns a random integer from 1 to 3, inclusive. The second call to RANDOM returns a random integer from 2 to 5, inclusive. The third call to RANDOM returns a random integer from 4 to 8, inclusive. Therefore, the least possible sum is 1 + 2 + 4, or 7, and the greatest possible sum is 3 + 5 + 8, or 16.

Topics to watch videos on: 3.15, skill 4B

Q49

Incorrect Answer: B

Correction: A, code segment B traverses the entire list and compares all elements in the list to the first element. This includes comparing the first element to itself which will always evaluate to true; however, the first element in the list does not represent a student’s score. Code segment A traverses the list beginning with the second element, so it is correctly comparing only student scores to the maximum possible score, which is found by accessing scores. The variable found will only be set to true when a student’s score equals the maximum possible score. The code also sets the number of iterations to LENGTH(scores) - 1 to reflect that the first list element (maximum score) is skipped

Topics to watch videos on: 3.10, skill 2B