Q66:

  • You need to remove line 5 because the count should only be increased when the number is perfect, thus the count should be increased inside the loop.
  • Line 9 also needs to be remove because the currentNum needs to increment each time regardless whether or not the number is perfect, thus the currentNum increase line cannot be inside the for loop.

Q58: The following procedure is intended to return true if at least two of the three parameters are equal in value and is intended to return false otherwise. For which of the following procedure calls does the procedure NOT return the intended value?

  • I chose the answer “AnyPairs (“bat”, “cat”, “rat”)” when the correct answer should be “AnyPairs (“bat”, “cat”, “bat”)”
  • both of these parameters, when sent through the function result in false. However, in the case of bat; cat; and rat, 2/3 of the parameters are not equal so the function is doing its job when the result is false
  • But in the case of bat; cat; and bat, the function results in false but this should not be the case because 2/3 of the parameters are the same

Q50:

  • to run in reasonable time means that the time complexity is a polynomial. If it were to run in unreasonable time, the time complexity would be exponential
  • I is reasonable because the time complexity is 2n
  • II is reasonable because the time complexity is n^2
  • III is reasonable because the time complexity is constant
  • So the answer is that all three run in reasonable time, not just III

Q47:The procedure BinarySearch (numList, target) correctly implements a binary search algorithm on the list of numbers numList. The procedure returns an index where target occurs in numList, or -1 if target does not occur in numList. Which of the following conditions must be met in order for the procedure to work as intended?

  • I chose the answer “the length of numList must be even” but the answer was “the values in numList must be in sorted order”
  • what binary search does is it halves a list and checks to see if the “target” is higher or lower than the halfway cutoff. it continues this pattern till it lands on the target.
  • however, if the contents of the list are not sorted, binary search means nothing because there is no way to tell whether one half of the list has the target number or not.

Q38:Internet protocol version 6 (IPv6) has been introduced to replace the previous version (IPv4). Which of the following best describes a benefit of IPv6 over IPv4?

  • just remember that IPv6 allows for a greater number of addresses than IPv4, which allows more devices to be connected to the internet

Q18:

  • I misread the answers but it should be this one. Keep moving forward until that is no longer possible or (false) and then rotate right and repeat this all over again

Q16:

  • the index should be decreased each time regardless of whether or not the word at that index is “the” or “or”, thus the line “index ← index - 1 “ should not be inside the loop, but outside the loop

Q14:

  • the answer is “Step 3: Display the remainder of number divided by 10 and store the integer quotient in number.”
  • this is because we are trying to output the number in its opposite order. every time we divide the number by 10, the remainder is the last digit in the number so we return it first.
  • we then continue to divide the integer by 10 and returning the quotient and storing the integer until the number is 0

Q10:

  • the answer is:
  • a tip I learned is to only test the edge values, in this case 12 and 13. values that are not on the edge will always work, so to identify the function that actually works, use the edge numbers

Q2:A small team of wildlife researchers is working on a project that uses motion-activated field cameras to capture images of animals at study sites. The team is considering using a “citizen science” approach to analyze the images. Which of the following best explains why such an approach is considered useful for this project?

  • the answer is “The image analysis is likely to take a longer time for the research team than for a distributed group of individuals.”
  • this is correct because Citizen science involves members of the general public participating in scientific research. Distributing the image analysis work to a larger group of individuals allows the work to be completed in less time.
  • the answer is not that “The image analysis is likely to require complex research methods” because since the work is distributed to many nonprofessional individuals, the research is not likely to be complex