Sprint 3 - Closure
CSA Project CB Corrections
CB MCQ Corrections
The correct answer is 2, because integers can’t have any decimals, so the 2.3333 is “rounded” or truncated to 2.
The correct answer is if (last < 0) { return -1;}, because this returns the -1 indicating that there is no such element, as soon as there are no more terms to search through. When there is no more terms, last will be less than 0, becuase it will search through data[last = 0], and then subtract 1 from last, making it -1, and making it less than 0.
The correct answer is k + a1.length, because there is no reason for a +1 to a1.length. It will try to access an element at a position 1 more than the size of a1, meaning there will be an out of bounds error.
The correct answer is (a != b) | (b <= 7). I just forgot to flip the &&, which is an and, to an | , which is an or. The original statement is asking for the reverse of (a = b ) && (b > 7), which is (a != b) | (b <= 7). |
The correct answer is I and III only. III is included, because when x is incremented, 2 is added to it, in order for another term to be printed out, it must be in a multiple of 2. If it is 7, it will print a value for 1, 3, 5., and the it skips to 7, which is not less than 7, and not less than 6. x < 6 and x < 7 have the same output, so I and III is the correct answer.