2021 Practice Exam MCQ
Score:
12
Which of the following replacements for
- My answer: D
- Correct answer: C
- Corrections: With the code from D, since the robot can always move forward til the end, it will only end up going up and down and will never reach the gray square.
23
Question: Which of the following statements about the Internet is true?
- My answer: The Internet is a computer network that uses proprietary communication protocols.
- Correct answer: The Internet is designed to scale to support an increasing number of users.
- Corrections: The Internet uses standardized, open (nonproprietary) communication protocols. The Internet was designed to be scalable, using open protocols to easily connect additional computing devices to the network.
42
Question: What value is displayed as a result of executing the code segment?
- My answer: 9
- Correct answer: 3
- Corrections: The expression (item MOD 2) evaluates to 1 for odd values and evaluates to 0 for even values. As a result, the code segment adds 1 to result for each odd value in integerList. There are three odd values in the list, so 3 is displayed.
57
Question: Which of the following parallel computing solutions would minimize the amount of time it takes to execute all four processes?
- My answer: Running processes P and R on one processor and processes Q and S on the other processor
- Correct answer: Running processes P and Q on one processor and processes R and S on the other processor
- Corrections: With two processors running in parallel, execution time is minimized when the processors take on as close to an equal workload as possible. Running processes P and Q on one processor will take a total of 40 seconds. Running processes R and S on the other processor will take a total of 35 seconds. As the processors run in parallel, all four operations are completed in 40 seconds.
63
Question: The following table shows the value of expression based on the values of input1 and input2. Which of the following expressions are equivalent to the value of expression as shown in the table?
- My answer: (NOT input1) AND (NOT input2) and NOT (input1 AND input2)
- Correct answer: (NOT input1) OR (NOT input2) and NOT (input1 AND input2)
- Corrections: When input1 and input2 are both true, the expressions (NOT input1) and (NOT input2) are both false, so (NOT input1) OR (NOT input2) will evaluate to false. In all other cases, either (NOT input1) or (NOT input2) (or both) will evaluate to true, so (NOT input1) OR (NOT input2) will evaluate to true.
66
Question: Which of the following code segments assigns the correct number of bonus points to bonus for all possible values of timer ? Select two answers.
- My answer: C and D
- Correct answer: A and D
- Corrections: This code segment does not work as intended. For example, if timer is greater than 60, bonus is assigned 1500 in the first IF block. Then bonus is assigned 1000 in the second IF block. As a result, bonus will be assigned 1000 instead of the intended 1500.
68
Question: For which of the following contents of myList will the procedure NOT produce the intended results?
- My answer: A and D
- Correct answer: C and D
- Corrections: The code segment will iterate over myList from right to left, removing the all elements but the first. This results in the list [50], which contains no duplicates, as intended. C is correct because there is two duplicates 40 in that list, but they would not be taken out correctly.