2019 AP Computer Science A FRQ #4B

2019 AP Computer Science A FRQ #4B

Write the method evaluateLight, which computes and returns the status of a light at a given row and column based on the following rules. 1. If the light is on, return false if the number of lights in its column that are on is even, including the current light. 2. If the light is off, return true if the number of lights in its column that are on is divisible by three. 3. Otherwise, return the light’s current status. Timestamps Intro: 00:00 Pseudocode: 00:33 Writing the code: 03:20 Testing the first method call: 07:12 Testing the second method call: 09:10 Testing the third method call: 10:15 Testing the fourth method call: 11:02 Final solution: 11:51