Question: answer in processing It's late, and Cookie Monster is hungry. He's going to sneak downstairs to get a cookie from the cookie jar. But the
It's late, and Cookie Monster is hungry. He's going to sneak downstairs to get a cookie from the cookie jar. But the lights are off and it's dark! He will have to fumble for the lightswitch to brighten up the room. For this question, you will write a program that will simulate how bright the room is as the lights are turned on or off. Here is a description of how your program should behave Use a canvas of any reasonable size. Across the top of the canvas are 3 stationary lightbulbs (circles). If a lightbulb is currently turned on, it should be colored yellow. If it's currently turned off, it should be colored black when your program first starts, have 1 bulb on and the other 2 off When the user clicks a lightbulb Turn that lightbulb on Gif it was off) or off of it was on) The background color should depend on how many lightbulbs are currently turned on. If all of them are on it should be white. If all of them are off, it should be black. If one of them is on, it should be dark grey. If two of them are on it should be light grey I Figure 2. The canvas getting lighter as more lightbulbs are turned on Note that when all the lightbulbs are off, the entire canvas is black (black circles on a black background). so clicking on a lightbulb is slightly tricky. This is intentionally a little bit like fumbling around in the dark to turn on a light-switch when you can't see anything
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
