Skip to content

Makeup MCQ #8

@Shayanb1

Description

@Shayanb1

Score: 60/70 (~0.86)

Questions I got wrong

Image Image Image Image Image Image Image Image
  1. Why my answer was wrong: The counter is incremented once for each time the game piece moves. The game piece makes four moves before ending in the red space.

  2. Why my answer was wrong: By making this change, the procedure will immediately return true any time it encounters a value that is greater than or equal to the preceding value. It will not check any subsequent values in the list.

  3. Why my answer was wrong: Removing any three connections will not prevent devices B and C from communicating. For example, if connections A-C, C-D, and B-D are removed, then devices B and C can still communicate along the path B-E-F-C.

  4. Why my answer was wrong: It is possible for a message to be routed from device A to device I through more than four other devices. One possible path is A-B-G-E-H-F-I.

  5. Why my answer was wrong: Algorithm II runs in time proportional to n^2, which is considered reasonable time because n^2 is a polynomial.

  6. Why my answer was wrong: Some individuals lack access to the Internet due to lack of network infrastructure. Building new infrastructure in remote areas may help reduce the digital divide for these individuals.

  7. Why my answer was wrong: In this code segment, the first call to botStepper moves the robot forward two squares, rotates it left so that it faces toward the top of the grid, moves it forward two squares, and rotates it right so that it faces right. The second call to botStepper moves the robot forward three squares, rotates it left so that it faces toward the top of the grid, moves it forward three squares, and rotates it right so that it faces right. The robot ends one square to the left of the gray square.

  8. Why my answer was wrong: Any ordering of the three steps will identify the correct restaurant. Sequence III will work. Sorting by rating will put the greatest customer rating at the top of the list. Then filtering by number of ratings will remove restaurants without any ratings. Then filtering by payment type will remove the restaurants that do not accept credit cards.

  9. Why my answer was wrong: For example, when input1 is true and input2 is false, then (NOT input1) will be false and (NOT input2) will be true. Therefore, (NOT input1) AND (NOT input2) will be false instead of the intended value true.

  10. Why my answer was wrong: The code segment will iterate over myList from right to left, removing the sixth element (20), the third element (30), and the second element (30). This results in the list [30, 10, 20], which contains no duplicates, as intended.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions