Question 6

Which of the following best explains how data is typically assembled in packets for transmission over the Internet?

  • Wrong Answer: A
  • Correct Answer: B

Explanation: Each packet contains data to be transmitted, along with metadata containing information used for routing the data is the most accurate explanation of how data is typically assembled in packets for transmission over the Internet. In this process, the data is divided into smaller packets, each with its own header that includes information such as the source and destination addresses, packet sequence number, and packet size. These headers are used by routers to determine the most efficient path for the packets to take to reach their destination, and to reassemble the original data at the receiving end.

Question 24

Based on the information in the table, which of the following tasks is likely to take the longest amount of time when scaled up for a very large company of approximately 100,000 customers?

  • Wrong Answer: A
  • Correct Answer: D

Explanation: We can see from the table that as the size of the company increases, the time taken for backing up data increases significantly. For a small company of approximately 100 customers, it takes 2 hours to back up data, while for a large company of approximately 10,000 customers, it takes 200 hours, which is 100 times longer. Assuming that the relationship between company size and time taken for backing up data is linear, it would take 100 times longer for a very large company of approximately 100,000 customers, which means it would take 20,000 hours (200 hours x 100) to back up data for such a large company.

Question 36

For which of the following situations would it be best to use a heuristic in order to find a solution that runs in a reasonable amount of time?

  • Wrong Answer: A
  • Right Answer: B

Explanation: As this algorithm has a factorial efficiency, it does not run in a reasonable amount of time. A heuristic approach can be used to find an approximate solution than can run in a reasonable amount of time. In addition, A is incorrect becase this algorithm requires just one step, so it runs in a reasonable amount of time. Therefore, a heuristic is not appropriate.

Question 39

Which of the following CANNOT be displayed as a result of executing the code segment?

  • Wrong Answer: B
  • Right Answer: D

Explanation: B is wrong because 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 1 2 3 2 is a possible output. D is right because in the second iteration of the loop, i is equal to 2. Thus RANDOM(1, i) returns either 1 or 2. So, the output 1 3 2 4 is not possible.

Question 40

Which of the following describes the possible values of ans as a result of executing the code segment?

  • Wrong Answer: B
  • Right Answer: D

Explanation: For the first line, the value of ans is set to the sum of two RANDOM values, one generated in the range of 1 to 3, and the other generated in the range of 2 to 5. Therefore, the minimum possible value of ans is 3 (1+2) and the maximum possible value of ans is 8 (3+5). In the second line, a third RANDOM value is generated in the range of 4 to 8 and added to the current value of ans. Therefore, the minimum possible value of ans after the second line is 7 (3+4) and the maximum possible value of ans after the second line is 16 (8+8). Therefore, the possible values of ans as a result of executing the code segment are any integer value from 7 to 16, inclusive.

Question 44

Which of the following is a true statement about the student’s use of the computer scientist’s search procedure?

  • Wrong Answer: B
  • Right Answer: A

Explanation: The student is reusing the computer scientist’s procedural abstraction by knowing what the procedure does without knowing how it does it. The student is not modifying the search procedure, and is using it as-is to perform the search operation on the dictionary. By doing so, the student is reusing the procedural abstraction without needing to know the internal details of how the procedure works.

Question 45

Which of the following CANNOT be displayed as a result of executing the code segment?

  • Wrong Answer: A
  • Right Answer: D

Explanation: B is wrong because 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 1 2 3 2 is a possible output. D is right because in the second iteration of the loop, i is equal to 2. Thus RANDOM(1, i) returns either 1 or 2. So, the output 1 3 2 4 is not possible.

Question 50

Which of the following describes the possible values of ans as a result of executing the code segment?

  • Wrong Answer: C
  • Right Answer: D

Explanation: For the first line, the value of ans is set to the sum of two RANDOM values, one generated in the range of 1 to 3, and the other generated in the range of 2 to 5. Therefore, the minimum possible value of ans is 3 (1+2) and the maximum possible value of ans is 8 (3+5). In the second line, a third RANDOM value is generated in the range of 4 to 8 and added to the current value of ans. Therefore, the minimum possible value of ans after the second line is 7 (3+4) and the maximum possible value of ans after the second line is 16 (8+8). Therefore, the possible values of ans as a result of executing the code segment are any integer value from 7 to 16, inclusive.

Question 51

Which of the following is a true statement about the student’s use of the computer scientist’s search procedure?

  • Wrong Answer: D
  • Right Answer: C

Explanation: The student is reusing the computer scientist’s procedural abstraction by knowing what the procedure does without knowing how it does it. The student is not modifying the search procedure, and is using it as-is to perform the search operation on the dictionary. By doing so, the student is reusing the procedural abstraction without needing to know the internal details of how the procedure works.

Question 55

Which of the following CANNOT be displayed as a result of executing the code segment?

  • Wrong Answer: A
  • Right Answer: D

Explanation: B is wrong because 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 1 2 3 2 is a possible output. D is right because in the second iteration of the loop, i is equal to 2. Thus RANDOM(1, i) returns either 1 or 2. So, the output 1 3 2 4 is not possible.

Question 56

Which of the following describes the possible values of ans as a result of executing the code segment?

  • Wrong Answer: B
  • Right Answer: A

Explanation: For the first line, the value of ans is set to the sum of two RANDOM values, one generated in the range of 1 to 3, and the other generated in the range of 2 to 5. Therefore, the minimum possible value of ans is 3 (1+2) and the maximum possible value of ans is 8 (3+5). In the second line, a third RANDOM value is generated in the range of 4 to 8 and added to the current value of ans. Therefore, the minimum possible value of ans after the second line is 7 (3+4) and the maximum possible value of ans after the second line is 16 (8+8). Therefore, the possible values of ans as a result of executing the code segment are any integer value from 7 to 16, inclusive.

Question 66

Which of the following is a true statement about the student’s use of the computer scientist’s search procedure?

  • Wrong Answer: A
  • Right Answer: C

Explanation: The student is reusing the computer scientist’s procedural abstraction by knowing what the procedure does without knowing how it does it. The student is not modifying the search procedure, and is using it as-is to perform the search operation on the dictionary. By doing so, the student is reusing the procedural abstraction without needing to know the internal details of how the procedure works.