- This option is incorrect. A user’s email address is required to receive email from other people. An email address in itself does not contain any extra information about the user.
- Incorrect. The upgraded system selects the appropriate department based on the customer’s issue, so the customer does not have the ability to make an incorrect selection.
- This option is incorrect. Each item in inputList1 is checked to see if it appears in inputList2. If the item appears in inputList2, the item is appended to resultList. Items that appear in both lists are the only items that appear in resultList.
- This option is incorrect. The program does not work as intended. On the test case [9, 1, 4, 5], the program displays 28 but the correct sum is 19.
- This option is incorrect. Since “Diane” is not in nameList, the procedure will display 0, indicating that the procedure worked as intended.
- Incorrect. With this algorithm, it is possible that the same student will be selected twice instead of 2 different students being selected.
- Correct. To remove the first 2 characters of oldString, this code segment takes a substring starting at position 3. To remove the last 2 characters of oldString, the substring ends at the position that is 4 characters less than the length of oldString (since 4 characters are removed).
- Incorrect. This code segment leaves the robot four rows above its starting position and two rows above the gray square.
- Incorrect. The robot fails to rotate left after the first block of 3 moves forward and then fails to rotate right after the following block of 2 moves forward.
- Incorrect. After moving forward two squares, turning right, and moving forward four squares, if the robot were to turn right, then the next move forward would put the robot into the black region of the grid.
- Incorrect. In proc2, the call to proc1 occurs before the DISPLAY statement, so “to you” and “happy” are displayed before “birthday”.
- Incorrect. The printArgs procedure displays the value of num, then str, then num, rather than str, then num, then str. In addition, the first call to printArgs displays two asterisks, not one. The second call to printArgs displays one asterisk, not two.
- Incorrect. A simulation is often used when a real-world scenario is too impractical to test. A benefit of using a simulation is that it allows for rapid testing.
- Incorrect. As the size of the list grows, the number of steps needed to sort the list grows at an exponential rate, as the number of steps is equal to 2n
for a list of size n This indicates that the algorithm does not run in a reasonable amount of time.