Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that draws a stoplight. You should have a gray rectangle, and then three circles in the rectangle. The circles should be red,
Write a program that draws a stoplight. You should have a gray rectangle, and then three circles in the rectangle. The circles should be red, then yellow, then green. The rectangle should be centered on the screen. The yellow light should be centered on the screen, and the red and green light should be offset by BUFFER amount. BUFFER amount represents the distance from the center of one circle to the center of another circle. Implement the function drawcircle that draws a single circle. Use it to draw the red, yellow, and green lights. Since all of the lights are the same size and aligned vertically, the function only needs to take the y position and color as arguments. Note: Be sure to Include comments for all functlons that you use or create. IS a phayton programm
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started