Open avanthikadaita opened 1 week ago
Reflection: I learned the importance of understanding how code works at a deeper level, especially with loops and conditionals. Some of my answers were off because I didn't fully account for edge cases or misunderstood how certain conditions affect the flow. For example, the infinite loop in the while loop question could have been avoided by paying closer attention to the condition's behavior.
Tips for Improvement: Double-check edge cases: Make sure your logic handles all possibilities, including boundary cases like 0 or maximum values. Break down the code: Test small parts of the code or logic in isolation before applying it to larger structures. Read carefully: Pay attention to how each choice interacts with the variables and their limits. Practice more: The more you work through problems, the more patterns and solutions you'll recognize.
Your blog and reflection looks really good. You did amazing on your college board practice too. Some resources I found helpful for improvement and matched your test were... Unit 8 College Board Videos Extra College Board On Demand MCQ review videos
ArrayIndexOutOfBoundsException
whenlast
reaches -1, and Choice I doesn’t cause an error. Choice III works correctly.target
is at index 0. Option B properly returns -1 whenlast
is -1, avoiding an out-of-bounds error while still returning 0 for valid cases.arr[k + 1]
was printed instead ofarr[k]
. Answer E correctly prints values wherearr[k] > arr[k + 1]
:7 2 5 3 3 0
.getMileage(v)
is not valid syntax. Answer E correctly calls the method on eachVehicle
object in the loop.toString
from the superclass. Answer B is correct becausebooks[0]
is of typeBook
, which cannot directly call methods defined inAudioBook
, likepagesPerMinute()
.x
as an index inarr[x]
. Answer A correctly iterates through each value inarr
using an enhanced for loop and prints odd integers by checkingx % 2 != 0
.x
andy
of thePoint
class, which is not allowed. Choice II correctly initializescenter
usingnew Point(a, b)
and assignsradius
.x
is never equal to 6. Choice III works alongside Choice I to correctly terminate the loop after printing1, 3, 5
.