Correction
-
Q7 Move piece on game board
- The correct answer is C because the piece moves one space to the left to a yellow space, and the counter is incremented to 1. The piece then moves three spaces to the left to another yellow space, and the counter is incremented to 2. The piece then moves three spaces to the left to a green space, and the counter is incremented to 3. The piece then moves two spaces to the right to the red space, and the counter is incremented to 4.
-
Q14 Error in isIncreasing procedure
- The correction answer is C because the code now is returning true whenever the list is not increasing and returning false whenever the list is increasing, which is the opposite of what is intended. So by interchanging lines 8 and 12, the procedure will return true or false appropriately.
-
Q15 Use drawLine procedure to draw figure
- The correct answer is A because starts at the coordinate (1, 0). Inside the loop, a call to drawLine draws a vertical line segment of length len. By increasing xVal by 1 inside the loop, the next line segment will be drawn one position to the right. By increasing len by 1 inside the loop, the next line segment drawn will have its length increased by one. This has the effect of drawing the line segments shown in the figure from left to right.
-
Q17 Remove connections to disconnect devices B and C
- The correct answer is B because if connections B-A, B-D, B-E, and B-G are removed (or C-A, C-D, C-F, and C-I), then devices B and C can no longer communicate.
-
Q26 Algorithm not suited for parallel computing
- The correct answer is A because the efficiency of a parallel computing solution is limited by the sequential portion of the solution. If each step is dependent on the preceding step, then each step must wait for the previous step to complete before executing.
-
Q33 Efficiency of driving route algorithms
- The correct answer is B because Algorithm II runs in time proportional to n^2, which is considered reasonable time because n^2 is a polynomial.
-
Q35 Traffic ticket database
- The correct answer is B because the database only tracks the month and year that each ticket was issued.
-
Q39 Number of bits needed for item inventory
- The correct anser is C because 2^6 is 64 and 2^7 is 128 so the minimun is 7 bits.
-
Q42 Iterate over integerList
- The correct answer is A because 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.
-
Q46 Filtering and sorting restaurant data
- The correct answer is D because the relative order of the rows is not changed when the filters are applied, the order in which the actions are performed does not matter. So every option works.
-
Q47 Expression to count restaurants
- The correct answer is B because prcRange cannot be equal to both “lo” and “med” so it need toe be a OR not AND.
-
Q49 Ability of computers to solve problems
- The correct answer is D because an undecidable problem is one for which no algorithm can be constructed that is always capable of providing a correct yes-or-no answer.
-
Q52 Binary search on list of 128 items
- The correct answer is B because the list will start with 128 elements, then 64 elements, then 32 elements, then 16 elements, then 8 elements, then 4 elements, then 2 elements, then 1 element. So the total elements is 8.
-
Q54 Information determined by delivery truck database
- The correct answer is B because the data captured each time a truck enters or leaves the depot do not include any information about the number of customers or deliveries associated with the truck.
-
Q59 Data not provided by user device
- The correct answer is C because in order to share Adrianna’s running route with nearby users, the application needs to know the current locations of users other than Adrianna.
-
Q63 Boolean expression equivalent to table
- The correct answer is A and D. D is correct because input1 AND input2 will evaluate to false, so NOT (input1 AND input2) will evaluate to true.
-
Q64 Boolean expression equivalent to table
- The correct answer is B and C. B is correct because this return statement causes execution of the procedure to end early. As a result, if age is less than 18, result will never be assigned the value “minor”.
-
Q65 Hot and humid conditionals
- The correct answer is B and C. C is correct because hot OR humid evaluates to true, the body of the IF statement is executed. Since hot is true, true is displayed.
-
Q66 Set bonus points based on timer
- The correct anwser is A and D. A is correct because this code segment assigns 500 bonus points by default. If timer is less than 30, no additional bonus points are added. If timer is between 30 and 60 inclusive, bonus is incremented by 500 in the first IF block. If timer is greater than 60, bonus is incremented by 500 twice.
-
Q68 Error in remove duplicates code segment
- The correct answer is A and C. C is the correct because this list does not contain any pairs of adjacent elements that are equal in value, so no elements will be removed even though the value 40 appears twice in the list.
Reflection
I got a 50/70. After doing all these correction, I feel like I need to do questions more detaily and carefully, because I made some silly mistake in this quiz. I also need to practice more and do more questions to build up my basic knowledge and the speed I do these questions. Overall, I feel like I still need to improve and raise my grade up more.