Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CODEHS Graphics Stop Light Write a program that draws a stoplight. You should have a gray rectangle, and then three circles in the rectangle. The

CODEHS Graphics Stop Light

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 draw_circle 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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

App Inventor

Authors: David Wolber, Hal Abelson

1st Edition

1449397484, 9781449397487

More Books

Students also viewed these Programming questions

Question

Write each series using summation notation. 1 + 4 + 9 + 16

Answered: 1 week ago