$30
For this assignment make a form that will hold your traffic light. The traffic light appears to be embedded in the form. The following is an illustration of the traffic light inside the form. The example shows the red light “on”, and the yellow and green lights are “off”.
Only one light is on at any time. If the green light is on then the other two lights are grayed out.
Programming specifications
When the program starts the traffic light is off (no electricity).
When the user clicks on “Start” the traffic begins normal operations at the default speed “slow”, which is explained in the next paragraphs.
If the user clicks on “Pause” then the traffic light freezes. The traffic signal does not turn off the electricity; it simply pauses where it is. When “Pause” is clicked the string “Pause” on that button changes to “Resume”. When “Resume” is clicked the string “Resume” changes to the string “Pause”.
If the user clicks on “Resume” then the traffic signal begins operation from the point in time when operation was suspended.
At any time the user may change the speed (rate of change) by clicking on one of the radio buttons. Here are the rates for slow and fast operation. The numbers represent number of seconds each light is on.
Red light
Green light
Yellow light
Fast
4.0 s
3.0 s
1.0 s
Slow
8.0 s
6.0 s
2.0 s
The table shows how many seconds the light remains ‘on’ in each mode of operation. For example, in the ‘Slow’ mode of operation the red light is on for 8 seconds, followed by the yellow light on for 2.0 second, followed by the green light ‘on’ for 6.0 seconds.