Question: Visual Basic 2. Create a form with three buttons: a red one, a yellow one, and a green one. Declare an integer with value 0.
Visual Basic
2. Create a form with three buttons: a red one, a yellow one, and a green one. Declare an integer with value 0. Develop a function that adds one to the integer and then uses the remainder (with respect to the number of lights) to cycle through the lights as if it were a stoplight (by changing their visibility). Add a label with large text to display what the driver should do at the current state of the light (STOP, SLOW DOWN, GO respectively). Create a fourth button that is used to call that function when pressed and uses an If block to assign the proper value of the text.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
