Saathvika AP MCQ Corrections - samayass/flask_portfolio GitHub Wiki

image

  • Q7 - Answer C - Correct. The game piece begins at the rightmost black space. 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. The algorithm terminates now that the piece is in the red space.
  • Q8 - Answer C - Correct. If a particular device or connection on the Internet fails, subsequent data will be sent via a different route, if possible. This is supported by redundancy in the network.
  • Q12 - Answer C - Correct. For each iteration of the loop, this code segment rotates the robot left if there is an open square to its left. Then, whether or not the robot rotates left, the code segment attempts to move the robot forward one square. In the first three iterations of the loop, the robot moves forward three squares from its initial location. In the next iteration of the loop, it rotates left. In the next three iterations of the loop, it moves forward three squares. In the next iteration of the loop, it rotates left. In the last three iterations of the loop, it moves forward three squares to the gray square at the bottom left corner of the grid.
  • Q25 - Answer D - Correct. The procedure initially sets result to 1 and j to 2. In the REPEAT UNTIL loop, result is first assigned the sum of result and j, or 1 + 2. The value of j is then increased to 3. In each subsequent iteration of the loop, result is increased by each successive value of j (3, 4, 5, etc.) until j exceeds n. Therefore, the procedure returns the sum of the integers from 1 to n.
  • Q28 - Answer D - Correct. The value of k is repeatedly decremented by 1 inside the loop until k = 0. If k is initially negative, it will continue to decrease without ever reaching 0.
  • Q43 - Answer A - Correct. Keylogging is the use of a program to record every keystroke made by a computer to gain fraudulent access to passwords and other confidential information.
  • Q55 - Answer C - Correct. This code segment assigns the value of the last element of the list to the variable temp, then removes the last element of the list, then inserts temp as the first element of the list.
  • Q65 - Answer B and Answer C - Correct. Since NOT humid evaluates to true, the body of the IF statement is executed. Since hot OR humid evaluates to true, true is displayed. Since hot OR humid evaluates to true, the body of the IF statement is executed. Since hot is true, true is displayed.