Status: Not Started
- LightBoard.txt
Font Size
14
Parentheses autocomplete
Wrap lines
Editor
Theme
Code with blocks by default
Console Font Size
12
Console Theme
Show File Tab Bar
3 LightBoard Part B (Text Only)
LightBoard.txt
1
2
public class LightBoard
{
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output
Docs
Exercise
More
History
Video
Download
About
This student is viewing this assignment in English. View this page in English?
5 points
Write the method evaluateLight
, which computes and returns the status of a light at a given row and column based on the following rules.
- If the light is on, return
false
if the number of lights in its column that are on is even, including the current light. - If the light is off, return
true
if the number of lights in its column that are on is divisible by three. - Otherwise, return the light’s current status.
For example, suppose that LightBoard sim = new LightBoard(7, 5)
creates a light board with the initial state shown below, where true
represents a light that is on and false
represents a light that is off. Lights that are off are shaded.
Reset Code
Upload an image
Upload from your computer
Or paste a link here
Slides and Notes
No slides available for this video
About
Free Response